From f118ee8a021736a9836817cdc0b0c41a515a91b1 Mon Sep 17 00:00:00 2001 From: kevinmctigue Date: Mon, 23 Jan 2012 14:31:59 -0500 Subject: [PATCH] Added an example to the connections samples to show users that the ['collections'] array is optional on connect. --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 4dfb2ee..aa4c7bb 100644 --- a/README.md +++ b/README.md @@ -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: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