For AI agents: a documentation index is available at https://www.mongodb.com/docs/llms.txt — markdown versions of all pages are available by appending .md to any URL path.
Docs Menu

Create, View, Update, and Delete Documents

You can use the Atlas UI to manage documents inside your collections. Documents are individual records in a MongoDB collection and are the basic unit of data in MongoDB.

Viewing documents and collections in the Atlas UI can provide a high-level overview of your database schema. You can use the Atlas UI to ensure you are following MongoDB's core data modeling concepts, such as utilizing embedded documents and arrays.

To insert, edit, or delete documents, you must have been granted access through one of the following roles:

To add one or more documents to a collection through the Atlas UI, you can specify the documents to insert from scratch or you can clone an existing document and modify its fields and values as needed.

To insert documents into your collection, use one of the following methods in Atlas:

  • Shell Syntax Mode: Write or paste documents in the MongoDB shell syntax, which allows unquoted field names and type constructors such as ObjectId() and ISODate(). Use this mode to insert multiple documents at once as an array.

  • Field-by-Field Editor: Select individual field values and types for each inserted document. You can only insert one document at a time using this method.

  • JSON Mode: Write or paste documents in Extended JSON format, which requires quoted field names and represents BSON types as wrappers such as {"$oid": "..."}. Use this mode to insert multiple documents at once as an array.

1
  1. If it's not already displayed, select the organization that contains your desired project from the Organizations menu in the navigation bar.

  2. If it's not already displayed, select your desired project from the Projects menu in the navigation bar.

  3. In the sidebar, click Clusters under the Database heading.

The Clusters page displays.

2
  1. If it's not already displayed, select the organization that contains your project from the Organizations menu in the navigation bar.

  2. If it's not already displayed, select your project from the Projects menu in the navigation bar.

  3. In the sidebar, click Data Explorer under the Database heading.

    The Data Explorer displays.

IMPORTANT: You can also click the name of a cluster to open the Cluster sidebar, and then click Data Explorer under the Shortcuts heading.

3

In the drop-down menu, click Insert Document.

Alternatively, you can right-click the query bar or its surrounding whitespace and select Insert document... from the drop-down menu.

4

In the Insert Document modal, click the icon to use Shell Syntax mode to insert documents into your collection.

Shell Syntax mode is the default view.

5

In the MongoDB shell syntax, type or paste the document(s) you want to insert into the collection. To insert multiple documents, enter a comma-separated array of documents.

Example

The following example inserts a single document into the collection. Field names are unquoted, and the _id, copies, and lastCheckedOut values use the ObjectId(), NumberInt(), and ISODate() type constructors instead of Extended JSON type wrappers:

{
_id: ObjectId('507f1f77bcf86cd799439011'),
title: 'The Odyssey',
author: 'Homer',
copies: NumberInt('10'),
lastCheckedOut: ISODate('2025-03-14T09:30:00Z')
}

Note

If you do not specify an _id value in your document, Atlas automatically generates an ObjectId for the _id field.

6

You can insert new documents by cloning the schema and values of an existing document in a collection.

To clone a document, hover over the desired document and click the Clone button.

Clone button
click to enlarge

When you click the Clone button, Atlas opens the document insertion dialog with the same schema and values as the cloned document. You can edit any of these fields and values before you insert the new document.

To view and manage documents, you can use one of the following views in the Documents tab:

  • List View: The default document view. Atlas shows documents in a list. In this view, you can expand embedded objects and arrays.

  • JSON View: Atlas shows documents as properly-formatted JSON objects. Atlas uses extended JSON to display the data types of each field.

  • Table View: Atlas shows documents as rows of a table, with document fields shown in the table columns. With this view, you can see which documents contain specific field values.

To expand embedded objects and array elements, hover over the document and click the arrow in the top-left corner.

Expand embedded objects list
click to enlarge

To copy a document to your clipboard, hover over the document and click the copy Copy icon:

Copy Document from List View
click to enlarge

The Atlas UI limits the total byte size of documents shown per page. As a result, you may see varying numbers of documents per page, especially if your documents vary significantly in size.

When you edit a document in List or Table view, Atlas performs a findOneAndUpdate operation and updates only those fields that you have changed.

When you edit a document in JSON view, Atlas performs a findOneAndReplace operation and replaces the document.

To modify a document, hover over the document and click the pencil icon:

Document Edit Selection
click to enlarge

After you click the pencil icon, the document enters edit mode. You can now make changes to the fields, values, or data types of values.

To delete a field from a document, click the icon to the left of the field:

Document Deletion
click to enlarge

Once selected, the field is marked for removal and appears highlighted in red. Atlas asks for confirmation that you want to update the document by removing the field.

To add a new field in the document after an existing field, hover over the row number in the dialog and click on the plus sign. The row number is not part of the document but is part of the dialog display.

Add a field to a document
click to enlarge

You can also add a new field at the end of the document by pressing the tab key when your text cursor is in the value of the last document field.

To modify documents, click on existing field names or values and make changes. In this example, the borough was changed from Manhattan to Queens. Changed fields appear highlighted in yellow:

Document Update View
click to enlarge

When you edit a document in List or Table view, Atlas performs a findOneAndUpdate operation and updates only those fields that you have changed.

If Atlas detects that you have changed fields that were modified outside of Atlas, it notifies you, preventing you from accidentally overwriting the changes made outside of Atlas. You can choose to proceed and replace the document by clicking Replace, or cancel your changes.

When you are finished editing the document, click the Update button to commit your changes.

To revert changes to a document, hover over the edited field and click the revert icon which appears to the left of the field's line number.

Revert Document in List View

You can use the bulk update operations workflow to update multiple documents in Atlas. For details, see Modify Multiple Documents.

To delete a document from a collection through the Atlas UI:

To delete a document, hover over the document and click the icon.

Delete button in List view
click to enlarge

After you click the delete button, the document is flagged for deletion. Atlas asks for confirmation that you want to remove the document.

Once you confirm, Atlas deletes the document from the collection.