I have a node.js application that is deployed to azure using CosmosDB and the MongoDB API. My application uses mongoose which works seamlessly in 4.13.9.
My application
For the latest version (v5.0.1) of Mongoose, you'll need to use this syntax to connect to MongoDB like this:
const mongoose = require('mongoose');
mongoose.connect('mongodb://.documents.azure.com:10255/?ssl=true', {
auth: {
user: '',
password: ''
}
})
.then(() => console.log('connection successful'))
.catch((err) => console.error(err));