Navigation

Manage Documents in Data Explorer

You can use the Data Explorer to manage documents inside your cluster collections.

To access the Data Explorer:

  1. Click Clusters in the top-left corner of Atlas.
  2. Click Collections for your desired cluster.

Or, if you are already viewing a specific cluster, select the Collections tab.

Required Roles

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

View Documents

From the Collections tab, you can view documents in a collection. To view documents for a collection:

1

Select the database for the collection.

The main panel and Namespaces on the left side list the collections in the database.

Screenshot highlighting databases in Data Explorer.
2

Select the collection on the left-hand side or in the main panel.

The main panel displays the Find view and the Indexes view.

3

Select the Find view.

The panel displays the documents in the collection. Each page displays up to 20 documents.

Screenshot highlighting documents in Data Explorer.
4

Optional. Specify query filter.

To specify filter condition, type in a query filter document in the filter bar. For example, to specify equality condition, use a filter document of the form:

{ <field1>: <value1>, ... }

To use query operators to specify a filter condition, use a filter document of the form:

{ <field1>: { <queryoperator>: <value1> }, ... }

Note

Data Explorer does not support date queries that use the IsoDate() function. Instead, use the MongoDB Extended JSON (v2) $date data type for date queries.

For example, the following query returns all documents where the date added to a created_at field is equal to or more recent than midnight on January 1, 2019, UTC time:

{ created_at: { $gte: { $date: "2019-01-01T00:00-00:00" } } }

For more information on specifying query filters, including compound conditions, see Query Documents.

5

Click Find to run query.

Insert Multiple Documents

To add a document to a collection through the Data Explorer, you can specify the document to insert from scratch or you can clone an existing document and modify its fields and values as needed.

Insert One Document

1

Go to Find tab in Data Explorer.

Select the collection and go to the Find tab.

2

Click Insert Document button.

The document editor appears with the _id field with an ObjectId value that reflects the time of its generation and not the insertion time of the document. As such, the ObjectId does not represent a strict insertion order.

3

Modify the document.

  • To add a new field after an existing field, hover over the field and click on the plus sign that appears over the field’s line number.
  • To delete a field, hover over the field and click on the x sign that appears to the left of the field’s line number. You cannot delete the _id field.
  • To edit a field name, value, or type, click on the field name, value, or type.
4

Click Insert.

Clone One Document

1

Go to Find tab in Data Explorer.

Select the collection and go to the Find tab.

Up to 20 documents displays in the tab.

2

Optional. Specify a filter.

To specify filter condition, type in a query filter document in the filter bar. For example, to specify equality condition, use a filter document of the form:

{ <field1>: <value1>, ... }

To use query operators to specify a filter condition, use a filter document of the form:

{ <field1>: { <queryoperator>: <value1> }, ... }
3

Clone the document.

To clone a document displayed in the query results, hover over the document and click on its clone document icon.

Clone document icon

The document editor appears with the _id field with an ObjectId value that reflects the time of its generation and not the insertion time of the document. As such, the ObjectId does not represent a strict insertion order.

4

Modify the document.

  • To add a new field after an existing field, hover over the field and click on the plus sign that appears over the field’s line number.
  • To delete a field, hover over the field and click on the x sign that appears to the left of the field’s line number. You cannot delete the _id field.
  • To edit a field name, value, or type, click on the field name, value, or type.
5

Click Insert.

Edit One Document

To edit a document from a collection through the Data Explorer:

1

Go to Find tab in Data Explorer.

Select the collection and go to the Find tab.

Up to 20 documents displays in the tab.

2

Optional. Specify a filter.

To specify filter condition, type in a query filter document in the filter bar. For example, to specify equality condition, use a filter document of the form:

{ <field1>: <value1>, ... }

To use query operators to specify a filter condition, use a filter document of the form:

{ <field1>: { <queryoperator>: <value1> }, ... }
3

Edit the document.

To edit a document displayed in the query results, hover over the document to edit and click on the pencil icon.

The document appears in the document editor:

  • To add a new field, hover over the field and click on the plus sign that appears over the field’s line number.
  • To delete a field, hover over the field and click on the x sign that appears to the left of the field’s line number. You cannot delete the _id field.
  • To edit a field name, value, or type, click on the field name, value, or type.
  • To revert a specific change, hover over the edited field and click the revert icon that appears to the left of the field’s line number.
4

Save or cancel changes.

To confirm and save changes, click the Update button.

To cancel all modifications to the document, click the Cancel button.

Delete One Document

To delete a document from a collection through the Data Explorer:

1

Go to Find tab in Data Explorer.

Select the collection and go to the Find tab.

Up to 20 documents displays in the tab.

2

Optional. Specify a filter.

To specify filter condition, type in a query filter document in the filter bar. For example, to specify equality condition, use a filter document of the form:

{ <field1>: <value1>, ... }

To use query operators to specify a filter condition, use a filter document of the form:

{ <field1>: { <queryoperator>: <value1> }, ... }
3

Delete the document.

To delete a document displayed in the query results, hover over the document to delete and click on the trash can icon.

The document is flagged for deletion.

4

To confirm, click the Delete button.