Skip to content

Commit 1ae1d42

Browse files
committed
transformWhere in MongoAdapter
1 parent 4052470 commit 1ae1d42

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/Adapters/Storage/Mongo/MongoStorageAdapter.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,9 @@ export class MongoStorageAdapter {
199199

200200
// Executes a find. Accepts: className, query in Parse format, and { skip, limit, sort }.
201201
find(className, query, { skip, limit, sort }, schema) {
202+
let mongoWhere = this.transform.transformWhere(className, query, schema);
202203
return this.adaptiveCollection(className)
203-
.then(collection => collection.find(query, { skip, limit, sort }))
204+
.then(collection => collection.find(mongoWhere, { skip, limit, sort }))
204205
.then(objects => objects.map(object => transform.mongoObjectToParseObject(className, object, schema)));
205206
}
206207

src/Controllers/DatabaseController.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -696,12 +696,12 @@ DatabaseController.prototype.find = function(className, query, {
696696
query = addReadACL(query, aclGroup);
697697
}
698698
validateQuery(query);
699-
let mongoWhere = this.transform.transformWhere(className, query, schema);
700699
if (count) {
700+
let mongoWhere = this.transform.transformWhere(className, query, schema);
701701
delete mongoOptions.limit;
702702
return collection.count(mongoWhere, mongoOptions);
703703
} else {
704-
return this.adapter.find(className, mongoWhere, mongoOptions, schema)
704+
return this.adapter.find(className, query, mongoOptions, schema)
705705
.then(objects => objects.map(object => filterSensitiveData(isMaster, aclGroup, className, object)));
706706
}
707707
});

0 commit comments

Comments
 (0)