Hi @@rwkd26 ,
I was looking into the youtube video link you provided but could not get much out of it. Then there was this link which is having more insight.
Instead of declaring the entire connection string in 'MONGO_URI' variable can you please create below variables. You can provide the database name which you want to use:
COSMOSDB_USER = "<Azure Cosmos account's user name, usually the database account name>"
COSMOSDB_PASSWORD = "<Azure Cosmos account password, this is one of the keys specified in your account>"
COSMOSDB_DBNAME = "<Azure Cosmos database name>"
COSMOSDB_HOST= "<Azure Cosmos Host name>"
COSMOSDB_PORT=10255
Post this you can use the below code to connect:
mongoose.connect("mongodb://"+process.env.COSMOSDB_HOST+":"+process.env.COSMOSDB_PORT+"/"+process.env.COSMOSDB_DBNAME+"?ssl=true&replicaSet=globaldb", {
auth: {
user: process.env.COSMOSDB_USER,
password: process.env.COSMOSDB_PASSWORD
},
useNewUrlParser: true,
useUnifiedTopology: true,
retryWrites: false
})
All this is mentioned in the same article I provided link for.
Please let me know if this works, or else we can discuss more.