mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
don't use options.limit in findOne()
This commit is contained in:
@@ -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];
|
||||
|
||||
@@ -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];
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user