I use the Microsoft Azure Comos Emulator version 2.11.11.0. I start it with the command line:
CosmosDB.Emulator.exe /EnableMongoDbEndpoint=3.6
If I connect with my application to the MongoDB endpoint I receive the follow error:
com.mongodb.MongoCommandException: Command failed with error 1 (InternalError):
'[ActivityId=64bdb726-f138-4025-8d5b-ca23bbda384c] Internal error.' on server localhost:10255.
The full response is {"ok": 0.0, "errmsg": "[ActivityId=64bdb726-f138-4025-8d5b-ca23
bbda384c] Internal error.", "code": 1, "codeName": "InternalError"}
What this error means? What I need to do else to use the MongoDB API?
Failing ist the first write command:
'{"createIndexes": "fs.files", "indexes": [{"key": {"filename": 1}, "name": "filename_1", "ns": "admin.fs.files"}], "$db": "admin", "lsid": {"id": {"$binary": {"base64": "lFHKYPJ0Rq+ip587pl8YPQ==", "subType": "04"}}}, "$readPreference": {"mode
": "primaryPreferred"}}'
It was produces from the simple Java line:
collection.createIndex( new BasicDBObject( FILENAME, 1 ) );
PS: With MongoDb endpoint 3.2 this is working. It must be any problem with the emulator.
With the emulator Mongo API 3.6 there must be created the collection explicit. With the original MongoDB and the Mongo API end point 3.2 the collection will be indirect created if a Index is created or data are saved.