MongoDB – Query Document In this chapter, we will learn how to query document from MongoDB collection. The find() Method To query data from MongoDB collection, you need to use MongoDB”s find() method. Syntax The basic syntax of find() method is as follows − >db.COLLECTION_NAME.find() find() method will display all the documents in a non-structured […]
Category Archives: mongodb
MongoDB – Delete Document In this chapter, we will learn how to delete a document using MongoDB. The remove() Method MongoDB”s remove() method is used to remove a document from the collection. remove() method accepts two parameters. One is deletion criteria and second is justOne flag. deletion criteria − (Optional) deletion criteria according to documents […]
MongoDB – Indexing Indexes support the efficient resolution of queries. Without indexes, MongoDB must scan every document of a collection to select those documents that match the query statement. This scan is highly inefficient and require MongoDB to process a large volume of data. Indexes are special data structures, that store a small portion of […]