CRUD operations create, read, update, and delete documents.
You can connect with driver methods and perform CRUD operations for deployments hosted in the following environments:
MongoDB Atlas: The fully managed service for MongoDB deployments in the cloud
MongoDB Enterprise: The subscription-based, self-managed version of MongoDB
MongoDB Community: The source-available, free-to-use, and self-managed version of MongoDB
To learn more about performing CRUD operations in the UI for deployments hosted in MongoDB Atlas, see Create, View, Update, and Delete Documents.
MongoDB provides the following methods to insert documents into a collection:
For examples, see Insert Documents.
You can specify query filters or criteria that identify the documents to return.
For examples, see:
db.collection.updateOne()New in version 3.2
db.collection.updateMany()New in version 3.2
db.collection.replaceOne()New in version 3.2
In MongoDB, update operations target a single collection. All write operations in MongoDB are atomic on the level of a single document.
You can specify criteria, or filters, that identify the documents to update. These filters use the same syntax as read operations.
For examples, see Update Documents.
Delete operations remove documents from a collection. MongoDB provides the following methods to delete documents of a collection:
You can specify criteria, or filters, that identify the documents to remove. These filters use the same syntax as read operations.
For examples, see Delete Documents.
MongoDB provides the ability to perform write operations in bulk. For details, see Bulk Write Operations.