Skip to content

Commit a763f7c

Browse files
committed
move transformWhere into mongo adapter
1 parent 135b0e0 commit a763f7c

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/Adapters/Storage/Mongo/MongoStorageAdapter.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,9 @@ export class MongoStorageAdapter {
206206
}
207207

208208
// Executs a count.
209-
count(className, query) {
209+
count(className, query, schema) {
210210
return this.adaptiveCollection(className)
211-
.then(collection => collection.count(query));
211+
.then(collection => collection.count(transform.transformWhere(className, query, schema)));
212212
}
213213

214214
get transform() {

src/Controllers/DatabaseController.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -696,8 +696,7 @@ DatabaseController.prototype.find = function(className, query, {
696696
}
697697
validateQuery(query);
698698
if (count) {
699-
let mongoWhere = this.transform.transformWhere(className, query, schema);
700-
return this.adapter.count(className, mongoWhere);
699+
return this.adapter.count(className, query, schema);
701700
} else {
702701
return this.adapter.find(className, query, mongoOptions, schema)
703702
.then(objects => objects.map(object => filterSensitiveData(isMaster, aclGroup, className, object)));

0 commit comments

Comments
 (0)