Search code examples
azure-cosmosdbazure-cosmosdb-mongoapi

Can you use DocumentDB SDK to connect to DocumentDB+MongoDB API?


When you go to create DocumentDB, it asks me what "NoSQL API" you want to use. You have a choice between "DocmentDB" and "MongoDB" but not both.

My question is, can you use DocumentDB SDKs to connect to the DB if you select MongoDB as the API?

Reason being is that I want to learn DocumentDB but also leverage MongoDB libs/tools. So I want to access some collections with MongoDB libs and others with DocumentDB SDK/libs on the same DB. Is this possible?

Thank you.


Solution

  • This is technical allowed, but highly discouraged because you could end up with documents that are not recognizable to MongoDB.

    You can have two collections within the same account, one for production using MongoDB and one for learning using DocumentDB. You can also download the DocumentDB emulator where you can test against DocumentDB for free, instead of sharing an account.