// use %40 for @
mongoClient.connect("mongodb://username:p%40ssword@host:port/dbname?authSource=admin");
MongoClient.connect('mongodb://admin:password@localhost:27017/db', function (err, db) {
mongodb://[Username:Password(optional)]@HostName:Port/?aruguments
note: if your password has special characters, you would need to URL-Encode.
ex : monodb://my-name:my-pass@localhost:27017/?authSource=users