Browse Source

Merge pull request #12 from kevinmctigue/patch-1

Added an example to connection samples
saintedlama/travis-non-legacy
Mathias Buus 13 years ago
parent
commit
215db4fa93
  1. 4
      README.md

4
README.md

@ -21,6 +21,10 @@ var db = require('mongojs').connect('example.com/mydb', ['mycollection']);
// we can also provide some credentials // we can also provide some credentials
var db = require('mongojs').connect('username:password@example.com/mydb', ['mycollection']); var db = require('mongojs').connect('username:password@example.com/mydb', ['mycollection']);
// connect now, and worry about collections later
var db = require('mongojs').connect('mydb');
var mycollection = db.collection('mycollection');
``` ```
After we connected we can query or update the database just how we would using the mongo API with the exception that we use a callback After we connected we can query or update the database just how we would using the mongo API with the exception that we use a callback

Loading…
Cancel
Save