MongoDB CRUD operations
Regardless of why you are using a MongoDB server, you'll need to perform CRUD operations on it. These fundamental methods, collectively known as CRUD operations, form the basis of interacting with a MongoDB server. To modify MongoDB documents, the process involves connecting to the server, querying the relevant documents, adjusting the specified properties, and subsequently transmitting the data back to the database for updates. Each CRUD operation serves a distinct purpose:
- The create operation is used to insert new documents in the MongoDB database
- The read operation is used to query a document in the database
- The update operation is used to modify existing documents in the database
- The delete operation is used to remove documents in the database
CRUD using mongosh
mongosh
is equivalent to the administration console used by relational databases.
- To connect to
mongosh
, enter the following command:mongosh "mongodb...