Understanding DocumentDB In Azure

Introduction

This article will cover the following.

  • Brief Concepts and Prerequisites
  • Implementation – Create CosmosDB account of API type DocumentDB in Azure
  • Implementation – Manage the collections in the DocumentDB
  • Implementation – Querying through the document in the collection of DocumentDB

Brief Concepts

What is Azure DocumentDB?

It is a NoSQL document database service designed from the ground up to natively support JSON and JavaScript directly inside the database engine.

Prerequisites

Read the following article to create an Azure account and for some basic information about Azure to get started.

Implementation – Create CosmosDB account of API type DocumentDB in Azure

Steps to be followed:

  • Open the Azure portal, click on the "Add" symbol to add Databases, and select Azure CosmosDB.
  • Mention the name and use the existing resource group. Then, set the API type to DocumentDB.
  • Go to the Cosmos DB section and see the newly created DocumentDB.

Implementation – Manage collection in the DocumentDB

Steps to be followed -

  • Go to the “Azure Cosmos DB” and click on the “Add Collection” by providing the name and provide the document DB ID as well. Then, click “Create”.
  • See the collections created just now.
  • Create the “New Document” from the option after choosing the newly created collection.
  • Put a simple JSON into the new document and save the document which will be named "1" based on the id.
  • See the documents created in the collection in Cosmos DB, using DocumentDB API. Now, one more thing - we can edit and delete the document very easily.

Implementation – Querying through the document in the collection of Document DB

Steps to be followed -

  • Create a new “SQL Query” from the menu option on the document in the collection.
  • Write the query where name is “Gourav” and then execute the query.

Happy learning!


Similar Articles