Remove options from count
This commit is contained in:
@@ -206,9 +206,9 @@ export class MongoStorageAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Executs a count.
|
// Executs a count.
|
||||||
count(className, query, { skip }) {
|
count(className, query) {
|
||||||
return this.adaptiveCollection(className)
|
return this.adaptiveCollection(className)
|
||||||
.then(collection => collection.count(query, { skip }));
|
.then(collection => collection.count(query));
|
||||||
}
|
}
|
||||||
|
|
||||||
get transform() {
|
get transform() {
|
||||||
|
|||||||
@@ -697,8 +697,7 @@ DatabaseController.prototype.find = function(className, query, {
|
|||||||
validateQuery(query);
|
validateQuery(query);
|
||||||
if (count) {
|
if (count) {
|
||||||
let mongoWhere = this.transform.transformWhere(className, query, schema);
|
let mongoWhere = this.transform.transformWhere(className, query, schema);
|
||||||
delete mongoOptions.limit;
|
return this.adapter.count(className, mongoWhere);
|
||||||
return this.adapter.count(className, mongoWhere, mongoOptions);
|
|
||||||
} else {
|
} else {
|
||||||
return this.adapter.find(className, query, mongoOptions, schema)
|
return this.adapter.find(className, query, mongoOptions, schema)
|
||||||
.then(objects => objects.map(object => filterSensitiveData(isMaster, aclGroup, className, object)));
|
.then(objects => objects.map(object => filterSensitiveData(isMaster, aclGroup, className, object)));
|
||||||
|
|||||||
Reference in New Issue
Block a user