The design of Cosmos DB is done in such a way that you can easily integrate it with your app without doing much extra work. I mean, you don't need to do the configuration and management part, which is a huge pain with these NoSQL databases; you can easily connect to the Cosmos DB MongoDB using the existing Node.js modules you are aware of.
We are going to use the same set of node modules that we use for the normal development with MongoDB, no extra stuff!
Let's prove this point by configuring the existing project written in Node.js and MongoDB with our Cosmos DB Mongo API.
For a demonstration, we are going to use a sample code hosted as an open source:
https://github.com/prashanthmadi/mean
Let's do it:
- First things first, download the code. You can either use
git
or just visit the GitHub repository and download it as a ZIP. I am going to usegit
now. - Run this command in the Terminal to download the project:
git clone https://github.com/prashanthmadi/mean
- Once...