Navigation

Data Explorer

The Data Explorer provides the ability to:

  • View databases,collections and indexes in your cluster.
  • Create and drop databases, collections, and indexes.
  • Insert/edit/delete documents.

Data Explorer reads from the primary unless the primary is unavailable. If the primary is unavailable, Data Explorer reads from a non-hidden, non-delayed secondary member.

Data Explorer uses the Automation Agent to retrieve all data. No Cloud Manager configuration changes are required to access the Data Explorer.

Enable or Disable Data Explorer for a Project

Required Privileges

To enable Data Explorer for a project, you must have the Project Owner role for the project.

Data Explorer is enabled by default. To disable or enable Data Explorer:

1

Click Settings.

2

Toggle the button next to Database Explorer.

Access Data Explorer

Note

To access Data Explorer, you must have access provided by at least one of the following roles:

Data Explorer is not available for trial versions of Cloud Manager after the initial 30 day trial period.

To access Data Explorer, click Deployment and then the managed MongoDB deployment to introspect. Select the Data Explorer tab. The tab lists the datatabases in your deployment and the collections in each database.

View Databases and Collections

From the Data Explorer tab, you can view the databases and collections in the deployment. To view the collections in a particular database, expand the database. To expand the database, you can either click on the database name or on the expand icon. If you click on the name of the database, the main panel displays the collection statistics for that database.

View Documents

From the Data Explorer 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 the left-hand side displays the collections in the datatabse.

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.

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> }, ... }

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

5

Click Find to run query.

Insert Documents

To insert a new document through the Data Explorer, you must have access provided by at least one of the following roles:

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 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 a 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 a Document

To edit a collection’s documents through the Data Explorer, you must have access provided by at least one of the following roles:

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 a Document

To delete documents from a collection through the Data Explorer, you must have access provided by at least one of the following roles:

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.

View Indexes

From the Data Explorer tab, you can view index information for a collection. To view index information for a collection:

1

Select the database for the collection.

The main panel and the left-hand side displays the collections in the datatabse.

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 Indexes view.

The indexes table lists the indexes and associated index information for the collection. Index information includes the index definition, the size, and the usage frequency.

Create a Database

To create a database through the Data Explorer, you must have access provided by at least one of the following roles:

To create a database through the Data Explorer,

1

Click Create Database.

2

Enter the Database Name and the Collection Name.

Enter the Database Name and the Collection Name to create the database and its first collection.

For more information on MongoDB database names and collection names, see Naming Restrictions.

3

Optional. Specify a capped collection.

Select whether the collection is a capped collection. If you select to create a capped collection, specify the maximum size in bytes.

4

Click Create.

Upon successful creation, the database and the collection appears in the Data Explorer.

Create a Collection

To create a collection through the Data Explorer, you must have access provided by at least one of the following roles:

To create a collection in an existing database through the Data Explorer,

Tip

To create the first collection in a new database, see Create a Database.

1

Click on the plus sign + icon for a database.

Either select or hover over the database to drop and click on the plus sign + icon.

2

Enter the Collection Name.

For more information on MongoDB collection names, see Naming Restrictions.

3

Optional. Specify a capped collection.

Select whether the collection is a capped collection. If you select to create a capped collection, specify the maximum size in bytes.

4

Click Create.

Upon successful creation, the collection appears underneath the database in the Data Explorer.

Create an Index

To create an index through the Data Explorer, you must have access provided by at least one of the following roles:

To create an index for a collection through the Data Explorer,

1

Go to the Indexes tab.

  1. Click the collection you wish to index.
  2. Click the Indexes tab under the collection name.
2

Click + Create Index.

In the Create Index modal, enter the index key specification document in the Fields box:

{ <field1>: <index type>, ... }

Example

To create a compound index on the fields category (ascending order) and score (descending order), specify the index specification document:

{ category: 1, score: -1 }

For more information on indexes, see Indexes.

3

(Optional) Specify the index options.

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

Example

To set the unique option and the name for the new index, enter this document:

{ unique: true, name: "myUniqueIndex" }
4

(Optional) Set the Collation options.

Locale is the ICU Locale code for local languages. To review the list of locales MongoDB collation supports, see the list of languages and locales.

  • To learn more about the specific collation options, see Collation in the MongoDB manual.
  • To learn which collation options are enabled by default for each locale, see Collation Locales and Default Values in the MongoDB Manual.
5

(Optional) Build indexes with rolling builds.

Select Build index via rolling process.

Important

Do not set the background construction option if you select this option. Background construction negates the performance benefit gained by building an index with a rolling build.

Building indexes with rolling builds reduces the performance impact of building indexes on replica sets and sharded clusters. Cloud Manager maintains the availability of the cluster by taking one node out of the cluster at a time, starting with the primary, building its index, and adding it back to the cluster. To learn more about building indexes with rolling builds, see Build Indexes on Replica Sets.

Index Options Incompatible with Rolling Index Builds

You cannot use the following options when creating an index that you want to build in a rolling manner:

Cloud Manager ignores these options if you specify them in the Options pane.

6

Click Create.

To learn how to create indexes, see the MongoDB Manual.

7

Confirm or reject your index.

The Confirm Operation modal appears.

  • If your index creation looks correct, click Confirm. This closes the modal and create the index.
  • If your index creation looks incorrect, click Cancel. This closes the modal without creating the index.

Drop a Database

To drop a database through the Data Explorer, you must have access provided by at least one of the following roles:

To drop a database, including all its collections, through the Data Explorer,

1

Drop the database.

Either select or hover of the database to drop and click on its trash can icon.

2

Confirm action.

Confirm by typing the name of the database, and click Drop.

Drop a Collection

To drop a collection through the Data Explorer, you must have access provided by at least one of the following roles:

To drop a collection, including its documents and indexes, through the Data Explorer,

1

Drop the collection.

Either select or hover of the collection to drop and click on its trash can icon.

2

Confirm action.

Confirm by typing the name of the collection, and click Drop.

Drop an Index

To drop an index through the Data Explorer, you must have access provided by at least one of the following roles:

To drop an index from a collection through the Data Explorer,

Note

You cannot delete the _id index.

1

Go to the Indexes tab.

Select the collection whose index you wish to drop, and go to the Indexes tab.

2

Click the Drop Index button for the index to drop.

3

Confirm action.

Confirm by typing the name of the index, and click Drop.