Skip to content

Commit a24c252

Browse files
authored
Merge pull request #1476 from maicss/patch-1
https://jira.mongodb.org/browse/NODE-932
2 parents d1a4e15 + 16ede54 commit a24c252

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

docs/reference/content/tutorials/connect/authenticating.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,10 @@ var MongoClient = require('mongodb').MongoClient,
3838
var user = encodeURIComponent('dave');
3939
var password = encodeURIComponent('abc123');
4040
var authMechanism = 'DEFAULT';
41-
var authSource = 'myproject';
4241

4342
// Connection URL
44-
var url = f('mongodb://%s:%s@localhost:27017?authMechanism=%s&authSource=',
45-
user, password, authMechanism, authSource);
43+
var url = f('mongodb://%s:%s@localhost:27017/myproject?authMechanism=%s',
44+
user, password, authMechanism);
4645

4746
// Use connect method to connect to the Server
4847
MongoClient.connect(url, function(err, db) {

0 commit comments

Comments
 (0)