All Products
Search
Document Center

Create a document

Last Updated: Jun 08, 2019

This section introduces how to create a document.

Prerequisites

You must have access permissions to DMS and be logged on to the DMS console.

Procedure

  1. Select an ApsaraDB for MongoDB instance and then click Log on to Database.

  2. After you log on to the instance, expand the left-side object list and then select the collection where you need to create the document. Right-click the collection and then select View Data to open the query window.

    mongodb-create-doc

  3. By default, a query command is executed in this window to query the documents in the collection. Click Create Document on the execution result tab page to open the document creation window, as shown in the following figure:

    mongodb-create-doc-1

    Notes

    • Enter the content of the document in the document creation window. The content must be compliant with the MongoShell standards.

    • You can choose to enclose element names in double quotation marks (“”). If an element name contains spaces, it must be enclosed in double quotation marks (“”).

  4. After you enter the content, click Check Format to check the format of the document.

    Note

    If the Format check successful message is displayed, the document has passed the format check. Otherwise, modify the content according to the error messages.

  5. After the format check is complete, click OK in the document creation window. Confirm the document creation command in the review dialog box and then click OK to create the document.