Remove options from count

This commit is contained in:
Drew Gross
2016-05-23 20:15:51 -07:00
parent e444ca8425
commit 135b0e0254
2 changed files with 3 additions and 4 deletions

View File

@@ -206,9 +206,9 @@ export class MongoStorageAdapter {
}
// Executs a count.
count(className, query, { skip }) {
count(className, query) {
return this.adaptiveCollection(className)
.then(collection => collection.count(query, { skip }));
.then(collection => collection.count(query));
}
get transform() {

View File

@@ -697,8 +697,7 @@ DatabaseController.prototype.find = function(className, query, {
validateQuery(query);
if (count) {
let mongoWhere = this.transform.transformWhere(className, query, schema);
delete mongoOptions.limit;
return this.adapter.count(className, mongoWhere, mongoOptions);
return this.adapter.count(className, mongoWhere);
} else {
return this.adapter.find(className, query, mongoOptions, schema)
.then(objects => objects.map(object => filterSensitiveData(isMaster, aclGroup, className, object)));