don't use options.limit in findOne()

This commit is contained in:
matt debergalis
2012-02-02 18:12:20 -08:00
parent 32d1e985a6
commit 42f82d9f63
2 changed files with 6 additions and 2 deletions

View File

@@ -266,6 +266,8 @@ if (typeof Meteor === "undefined") Meteor = {};
if (arguments.length === 0)
selector = {};
// XXX when implementing observe() on the server, either
// support limit or remove this performance hack.
options = options || {};
options.limit = 1;
return this.find(selector, options).fetch()[0];

View File

@@ -81,8 +81,10 @@ Collection.prototype.findOne = function (selector, options) {
if (arguments.length === 0)
selector = {};
options = options || {};
options.limit = 1;
// XXX disable limit here so that we can observe findOne() cursor,
// as required by markAsReactive.
// options = options || {};
// options.limit = 1;
return this.find(selector, options).fetch()[0];
};