Browse files

Updated doc with parameter

  • Loading branch information...
1 parent a58dd00 commit 3f5f699bc0cfbd49ca254b0e49fbfbbc9d43f5e9 Tony Mobily committed Mar 5, 2013
Showing with 4 additions and 1 deletion.
  1. +4 −1 README.md
View
5 README.md
@@ -8,8 +8,9 @@ Usage:
var mw = require('mongowrapper');
+ var mongoOptions = {}
- mw.connect('mongodb://localhost/yourdatabase', {}, function( err, db ){
+ mw.connect('mongodb://localhost/yourdatabase', mongoOptions, function( err, db ){
// db is defined here
// `mw.db` is also available
}
@@ -28,6 +29,8 @@ Modules can then:
});
+The module uses [mongoClient.connect()](http://mongodb.github.com/node-mongodb-native/api-generated/mongoclient.html#mongoclient-connect) to connect (yes, the new fancy syntax everybody should be using where you specify a connection URL!).
+
_Note:_ db might not be set by the time your modules get to it. Unless you are using the callback, you shouldn't use `mw.db` without checking if it's !== null.

0 comments on commit 3f5f699

Please sign in to comment.