Search code examples
node.jsmongodbazure-cosmosdbazure-cosmosdb-mongoapi

cosmosdb emulator mongo connection string Error: Slash in host identifier


I am trying to connect my NodeJs application with the CosmosDb emulator in localhost:

enter image description here

Since in my azure resouce group I am created a cosmodb instance of kind MongoDB

enter image description here

I am using the following connection string to test it in localhost:

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

unfortunatelly seems that the connection string provided doesn't fit very well...

enter image description here

What I am doing wrong?


Solution

  • The account key in the Mongo URL must be URL encoded. We should be doing this for you in the Web UI. I’ll add this as an issue to address in the next data explorer update.