Use this syntax:
// use %40 for @
mongoClient.connect("mongodb://username:p%40ssword@host:port/dbname?authSource=admin", {
useNewUrlParser: true
}, function(err, db) {
}
);
More Related Contents:
- Node.js Mongoose.js string to ObjectId function
- How to paginate with Mongoose in Node.js?
- mongoDB/mongoose: unique if not null
- Mongoose Unique index not working!
- How do you use Mongoose without defining a schema?
- How to access a preexisting collection with Mongoose?
- How do I query for distinct values in Mongoose?
- How to return Mongoose results from the find method?
- MongoDB: output ‘id’ instead of ‘_id’
- How can I update multiple documents in mongoose?
- Mongoose’s find method with $or condition does not work properly
- Delete a key from a MongoDB document using Mongoose
- Can’t find documents searching by ObjectId using Mongoose
- Updating a Nested Array with MongoDB
- Querying after populate in Mongoose
- Cascade style delete in Mongoose
- Comparing mongoose _id and strings
- Find MongoDB records where array field is not empty
- Creating Multifield Indexes in Mongoose / MongoDB
- UnhandledPromiseRejectionWarning: MongooseServerSelectionError
- How to protect the password field in Mongoose/MongoDB so it won’t return in a query when I populate collections?
- Mongoose, find, return specific properties
- How to use mongoose findOne
- Mongodb sort with case insensitive manner
- Mongoose: deep population (populate a populated field)
- Fail to connect Mongoose to Atlas
- Which SchemaType in Mongoose is Best for Timestamp?
- What is the difference between id and _id in mongoose?
- Mongoose: ObjectId Comparisons fail inconsistently
- Mongoose multiple connections