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