In this part, we will add a functionality to search for user by their name using regex in Mongo DB find function. We will also be using case insensitive search using regex “i”.

When someone send a friend request, we will add his document in friends nested array using Spush operator. Similarly, when someone unfriend the person, then we will remove his document from nested array using $pull operator.

We will also be using Socket IO for realtime communication between 2 users. We have a chat functionality and all messages are being stored in 3 level nested array in users document. So we will be updating third level nested array using Node JS and Mongo DB.

#node #node js #mongo db

Friends and Chat | How to Create a Social Networking Site in Node JS and Mongo DB
41.15 GEEK