Fix : remove query count limit
Remove the limit on query count. By default the limit is 100. If you try to get the count of a collection and the collection has more than 100 rows, the result is always 100.
This commit is contained in:
@@ -501,6 +501,7 @@ DatabaseController.prototype.find = function(className, query, options = {}) {
|
|||||||
mongoWhere = {'$and': [mongoWhere, {'$or': orParts}]};
|
mongoWhere = {'$and': [mongoWhere, {'$or': orParts}]};
|
||||||
}
|
}
|
||||||
if (options.count) {
|
if (options.count) {
|
||||||
|
delete mongoOptions.limit;
|
||||||
return collection.count(mongoWhere, mongoOptions);
|
return collection.count(mongoWhere, mongoOptions);
|
||||||
} else {
|
} else {
|
||||||
return collection.find(mongoWhere, mongoOptions)
|
return collection.find(mongoWhere, mongoOptions)
|
||||||
|
|||||||
Reference in New Issue
Block a user