I\'m trying to connect to a MongoDB database with a username and password using Mongoose in Node.js. All the docs say that the connection string should look like
<
Also, if your password contains a percentage, %,
Because the percent ("%") character serves as the indicator for percent-encoded octets, it must be percent-encoded as "%25" for that octet to be used as data within a URI
for example, if your password is John%Doe, the new transformed password will be John%25Doe or
If password is Paul%20Wait, New Password will be Paul%2520Wait
mongoClient.connect("mongodb://username:John%25Doe@host:port/dbname", function(err, db) {
// password is John%Doe
}`enter code here`
);