Adding data in MongoDB

Let's add few data in the MongoDB:

  1. Once the collection is created, you can add new documents to it. Click on Data Explorer from the left menu and select the database.
  2. Refer to the following screenshot if you are having difficulty finding the database:
  1. Click on New Document and it will open up the query editor. Copy the following document and paste in the editor, or you can create your own:
{ 
    "id": "10", 
    "name": "Shahid", 
    "location": "India" 
} 
  1. You can add more fields of your choice. Click on the Save button to add the record in the MongoDB collection. Repeat the steps to add multiple documents.
  2. You can also query the data you have added in the collection from the Data Explorer screen. Click on the New Mongo Query button on the top menu and it will open up an editor. Add any Mongo query you like, or just add {} to fetch all documents from the MongoDB collection.
  3. Refer to the following screenshot to see how it works:

Results may vary on your account.

So far we have created the Cosmos DB instance, created a new MongoDB database and collection, and added some dummy data to it. I think it's time to see how turnkey distribution works; is it really what Microsoft has promised? Feeling pumped? Me too; let's dive in.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.216.37.123