Alex Ch
Alex Ch

Reputation: 11

Connect to Cosmos DB emulator

When i connect to CosmosDB emulator like this:

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

everything works as expected but I have

promise rejection:
(node:1840) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: Password contains an illegal unescaped character
(node:1840) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

How to escape this @ ? Thanks

Upvotes: 1

Views: 707

Answers (1)

David Noble
David Noble

Reputation: 116

URL-encoding the password part of the connection string may fix this problem. Please try this connection string:

mongodb://localhost:C2y6yDjf5%2FR%2Bob0N8A7Cgv30VRDJIWEHLM%2B4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw%2FJw%3D%3D@localhost:10255/admin?ssl=true

Does that solve the problem?

Upvotes: 1

Related Questions