Permalink
Browse files

call nextObject for findOne vs limiting to one

  • Loading branch information...
1 parent 6be7b0b commit acc443816cc5716e37c3e9c07299336da5b64ab9 @crcn crcn committed Aug 22, 2012
Showing with 3 additions and 3 deletions.
  1. +2 −2 lib/collection.js
  2. +1 −1 package.json
View
4 lib/collection.js
@@ -79,10 +79,10 @@ outcome = require("outcome");
options = undefined;
}
- this.find(selector, options).limit(1).toArray(outcome.error(next).success(function(items) {
+ this.find(selector, options).nextObject(outcome.error(next).success(function(item) {
//return ONE item
- next(null, items[0]);
+ next(null, item);
}));
},
View
2 package.json
@@ -2,7 +2,7 @@
"author": "Craig Condon",
"name": "mongodblite",
"description": "self-contained mongodb implementation",
- "version": "0.0.1",
+ "version": "0.0.2",
"repository": {
"type": "git",
"url": "git://github.com/crcn/node-mongodblite.git"

0 comments on commit acc4438

Please sign in to comment.