From 23d29737fa7512414d81fb225c1198a500c4107c Mon Sep 17 00:00:00 2001 From: Sneha Gunda Date: Mon, 9 Apr 2018 18:09:22 -0700 Subject: [PATCH 1/2] Updating code as per GitHub issue GitHUb issue- https://github.com/MicrosoftDocs/azure-docs/issues/6905 --- server/mongo.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/mongo.js b/server/mongo.js index 97904e3..93428a2 100644 --- a/server/mongo.js +++ b/server/mongo.js @@ -3,10 +3,10 @@ const env = require('./env/environment'); mongoose.Promise = global.Promise; -const mongoUri = `mongodb://${env.dbName}:${env.key}@${env.dbName}.documents.azure.com:${env.cosmosPort}/?ssl=true`; +const mongoUri = `mongodb://${env.dbName}.documents.azure.com:${env.cosmosPort}/?ssl=true`; function connect() { - return mongoose.connect(mongoUri, { useMongoClient: true }); + return mongoose.connect(mongoUri, { auth: { user: env.dbName, password: env.key }}); } module.exports = { From 7604ba1398ee8a64a0f820346c3c4dfa2be43fdf Mon Sep 17 00:00:00 2001 From: Sneha Gunda Date: Tue, 10 Apr 2018 08:39:53 -0700 Subject: [PATCH 2/2] updating escape character --- server/mongo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/mongo.js b/server/mongo.js index 93428a2..fb3bd27 100644 --- a/server/mongo.js +++ b/server/mongo.js @@ -3,7 +3,7 @@ const env = require('./env/environment'); mongoose.Promise = global.Promise; -const mongoUri = `mongodb://${env.dbName}.documents.azure.com:${env.cosmosPort}/?ssl=true`; +const mongoUri = `mongodb://${env.dbName}.documents.azure.com:${env.cosmosPort}/?ssl/=true`; function connect() { return mongoose.connect(mongoUri, { auth: { user: env.dbName, password: env.key }});