Collection Management

The Collection Management tab in the Developer module allows you to manage the selected database within Ambience.

Any actions performed in this tab are irreversible. Proceed with caution.

The upper part of the page allows you to select the database and search the list of collections, as well as action buttons that you can perform on the database. The lower part of the page displays the collects for the selected database and the action icons that can be performed on the collection.

In this page, you can perform the following:

  • Database collection
    • Create collection
    • Drop one or multiple collections
    • Delete records in one or multiple collections
    • Refresh
    • Search
  • Collection
    • Rename
    • Open
    • Copy
    • Delete

Create New Database/Collection

To create a new database collection, click on the “Create New Database / Collection” button at the upper right corner of the page.

The “Create New Database / Collection” dialog box will appear.

In the “Database Name” field, the default value is the currently selected database. Change to the required database if the current database is not desired. Key in a unique name for the new collection in the “Collection Name” field. Click on the “OK” button to create the new database collection or click on the “Cancel” button to abort the action.

A notification will appear once the new database collection is created.

Drop Collections

To delete one or multiple collections, select the desired collections and click on the “Drop Collections” button at the upper right corner. Do note that this action is irreversible.

Upon successful deletion, the collections are removed from the database. One notification will appear for each collection.

Delete Records

To delete records of one or multiple collections, select the desired collections and click on the “Delete Records” button at the upper right corner. Do note that this action is irreversible.

Upon successful deletion, the records in the collections are removed, retaining their indexes. One notification will appear for each collection.

Refresh

The “Refresh” button at the upper right corner of the Query page allows you to refresh the page in case anyone or the database is being updated.

Search

There is a cross-field search function for the list of collections. It is located at the upper left corner of the page.

This provides an easy way to search through the collection list. It is case-insensitive and displays collections that have the entered search value in any of the values of the fields below:

  • Collection Name
  • Total Row Count

Rename Collection

You can rename a collection by clicking on the “Rename” icon under the “Actions” column corresponding the desired collection.

The “Rename MongoDB Collection” dialog box will appear.

Key in an unique name in the “Collection Name” field and click on the “OK” button to save the change. To abort, click on the “Cancel” button or the “X” icon at the top right of the dialog box.

Upon successful rename, a notification will appear.

Open Collection

To open a collection to view the records in the collection, click on the “Open” icon under the “Actions” column corresponding the desired collection.

All the records will be displayed in the “Results” tab.

See Results section for more information.

Copy Collection

This function allows you to copy records from one collection to another collection. It only works for MongoDB 4.4 onwards.

To copy the records in a collection and copy to another collection, click on the “Copy” icon under the “Actions” column corresponding the desired collection.

The “Copy MongoDB Collection” dialog box will appear.

The “Current Collection Name” field shows the where the records are copied from and it is not editable. The “New Collection Name” field, by default uses the same name as the “Current Collection Name” field. Change it to the desired collection name. It must be unique. In the “Copy to Database” field, select the appropriate database where the copied records are to be located from the drop-down list. Click on the “OK” button to copy the collection or click on the “Cancel” button to abort the action.

If the same collection name is used, an error message will appear.

If the copy is successful, a notification will appear.

Delete Collection

To delete a collection, click on the “Delete” icon under the “Actions” column corresponding the desired collection. Do note that this action is irreversible.

The “Drop MongoDB Collection” dialog box will appear.

The “Collection Name” field shows the collection to be deleted (not editable). The “Retain Indexes” field allows you to select whether to retain the indexes of the collection. By default it is not selected. If the “Retain Indexes” field is selected, the records in the collection will be removed but the collection remains in the database. Other else, the collection will be removed from the database. Click on the “Delete” button to delete the collection or click on the “Cancel” button to abort the action.

Upon successful deletion, a notification will appear depending on the selection made earlier.