MongoDB Basic Commands

1. show dbs  -> for seeing your databases

2. database_name -> for creating a new database and switch to database

3. show collections -> for seeing databases collections

4. db.dropDatabase()  -> for delete the database

5. db.createCollection('collection') -> for creating a collection 

6. db.dropCollection('collection_name') -> for delete the collection


MongoDB CRUD Operations

CRUD Operations create, read, update and delete documents.


Create Operations :

Create or insert operations add new documents to a collection. If the collection does not currently exist, insert operations will create the collection.

MongoDB provides the following methods to insert documents into a collection:


Read Operations :

Read operations retrieve documents from a collection; i.e. query a collection for documents. MongoDB provides the following methods to read documents from a collection:


Update Operations :

In MongoDB, update operations modify existing documents in a collection. MongoDB provides the following methods to update documents of a collection:


Delete Operations :

Delete operations remove documents from a collection. MongoDB provides the following methods to delete documents of a collections.