1

When I run

mongo --port 10255 --ssl

I get a connection to Cosmos db emulator in Mongodb mode. When I in that shell try to run

db.runCommand( { shardCollection: "myDB.myCollection", key: { myId: "hashed" } })

I get

{ "_t" : "OKMongoResponse",
"ok" : 0,
"code" : 13,
"errmsg" : "Not Authenticated",
"$err" : "Not Authenticated"
}

If I try to open the connection with the connectiong string I use in .net

mongo mongodb://localhost:C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==@localhost:10255/admin?ssl=true

I get

FailedToParse: Bad digit "C" while parsing C2y6yDjf5

How can I open up a shell to the cosmos db emulator to create a new collection as specified in this answer ComosDB - MongoAPI - Document does not contain shard key

Stennie
  • 63,885
  • 14
  • 149
  • 175
Mathias Rönnlund
  • 4,078
  • 7
  • 43
  • 96

0 Answers0