Skip to content

Commit

Permalink
Merge pull request #12 from kevinmctigue/patch-1
Browse files Browse the repository at this point in the history
Added an example to connection samples
  • Loading branch information
mafintosh committed Jan 23, 2012
2 parents 68ffc95 + f118ee8 commit 215db4f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ var db = require('mongojs').connect('example.com/mydb', ['mycollection']);

// we can also provide some credentials
var db = require('mongojs').connect('username:[email protected]/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
Expand Down

0 comments on commit 215db4f

Please sign in to comment.