0

I have a Document DB (using the DocumentDB interface, NOT the MongoDb interface), so the connection string looks like:

AccountEndpoint=https://SomeDatabase.documents.azure.com:443/;AccountKey=xxxxx;

it does NOT look like this:

mongodb://SomeDatabase:xxxxx==@SomeDatabase.documents.azure.com:10255/?ssl=true&replicaSet=globaldb

Question: How do I connect using RoboMongo or other MongoDb tools/code?

The stuff I looked at said things like take the username (that it shows in the MongoDb version of Cosmos DB (which won't help, as it is a totally different database and the connection string there won't work for apps that need the DocumentDb interface)

Is there a way to do this,or by 'adding support for MongoDB interface to Document DB' like adding the ability to talk to a Ms-SQL Server using MongoDB because you can always download MongoDb an install that on the same machine. (and not be able to get any data passed between them)

Traderhut Games
  • 1,222
  • 1
  • 15
  • 30
  • Instructions are on this page in their docs: https://learn.microsoft.com/en-us/azure/cosmos-db/connect-mongodb-account – Neil Lunn Jun 22 '17 at 22:07
  • And directly here [Get CustomConnection](https://learn.microsoft.com/en-us/azure/cosmos-db/connect-mongodb-account#GetCustomConnection). That took me all of two minutes to search – Neil Lunn Jun 22 '17 at 22:10
  • I've visited the pages and they do in fact exist. The connection string is liked to details from **your account** and changes for each customer. Show some effort and curb your rudeness please. – Neil Lunn Jun 22 '17 at 22:20

2 Answers2

3

When you use Cosmos DB, you must choose, for your deployed database, which API to use with it (DocumentDB, MongoDB, Tables, Gremlin). You cannot use multiple APIs against the same database.

The only way to use MongoDB tools & frameworks is to deploy a Cosmos DB database with the MongoDB API. The MongoDB API is what provides compatibility with MongoDB. Note: The oplog is not provided with the Cosmos MongoDB API, so tools that rely on reading/tailing the oplog will not work.

The DocumentDB API does not surface any of the MongoDB API, so you will not be able to use MongoDB-specific tools when deploying a DocumentDB-specific database.

Note: The MongoDB API of Cosmos does not surface an oplog, so any operations which attempt to query the oplog will not succeed.

David Makogon
  • 69,407
  • 21
  • 141
  • 189
  • This is what I was beginning to guess - thus, why I asked the question - which someone down-voted me for, most likely out of spite. So, the article I was reading on DocumentDb saying it was API compatible with MongoDb is incorrect. CosmosDB is, but only if you select the MongoDb interface. I was hoping that they had put two interfaces on the same data store - as they are both storing JSON in a similar fashion. – Traderhut Games Jun 22 '17 at 23:57
  • 1
    Please don't throw insults here - no need to accuse anyone of "spite." There's no need for you to even complain about your downvotes, especially on my answer (which has nothing to do with your question's votes, and explains exactly how CosmosDB works with API selection). And the documentation is correct; it just doesn't work the way you want it to (e.g. multiple APIs against the same data). – David Makogon Jun 23 '17 at 05:05
-3

Have you seen this how-to by Microsoft for this: Use Robomongo with an Azure Cosmos DB

And one more related: Connecting to Azure Cosmos DB emulator from RoboMongo

Gokhan Simsek
  • 273
  • 1
  • 5