MongoDB
Redis vs MongoDB
Redis and MongoDB both are open-source NoSQL databases. Both are similar in many ways. For example: Both are released in 2009. Both are NoSQL database….
CouchDB vs MongoDB
CouchDB and MongoDB both are popular NoSQL databases. MongoDB provides consistency and partition tolerance while CouchDB provides availability and partition tolerance. Let’s see the differences…
Cassandra vs MongoDB
Cassandra and MongoDB both are types of NoSQL databases. Cassandra is a distributed database system designed to handle large amount of data and known for…
MongoDB sort()
In MongoDB, sort() method is used to sort the documents in the collection. This method accepts a document containing list of fields along with their…
MongoDB limit()
In MongoDB, limit() method is used to limit the fields of document that you want to show. Sometimes, you have a lot of fields in…
Query Documents
In MongoDB, the db.collection.find() method is used to retrieve documents from a collection. This method returns a cursor to the retrieved documents. The db.collection.find() method…
Delete Documents
In MongoDB, the db.colloction.remove() method is used to delete documents from a collection. The remove() method works on two parameters. 1. Deletion criteria: With the…
Update Documents
In MongoDB, update() method is used to update or modify the existing documents of a collection. Syntax: db.COLLECTION_NAME.update(SELECTIOIN_CRITERIA, UPDATED_DATA) Example Consider an example which has a…
Insert Documents
In MongoDB, the db.collection.insert() method is used to add or insert new documents into a collection in your database. Upsert There are also two methods…
Drop collection
In MongoDB, db.collection.drop() method is used to drop a collection from a database. It completely removes a collection from the database and does not leave…