transformWhere in MongoAdapter

This commit is contained in:
Drew Gross
2016-05-23 17:39:07 -07:00
parent 4052470820
commit 1ae1d42c32
2 changed files with 4 additions and 3 deletions

View File

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