Tag: mongoDB

MongoDB Projection helps to return the specific fields from the query (or you can say from the MongoDB collection). By default, when we query any collection in MongoDB, it returns all fields in matching documents. Now, at times, we may not want all the records from the collection but a few of them in the […]

Indexes are important aspects while reading or fetching the documents. If we do not have indexes set up, we must scan every document of the collection to find and fetch the document that matches the query statement. Doing full scan degrades the performance of the application and is very inefficient considering when we are dealing […]

In this article, we will learn about MongoDB Find command. This command is used to query the documents available in the collection. This is similar to ‘select’ statement in the relational databases. As in SQL, we can use various options with ‘select’ statement to retrieve the data, here in MongoDB also, Find command provides various […]

In this chapter, we will learn about MongoDB insert documents – how to insert documents in the collections. There are following ways from which we can insert documents in the collections: insert () Method insertOne() Method insertMany () Method