Remove hidden properties from aggregate responses (#4351)
* Remove hidden properties from aggregrate responses * transform results from mongo & postgres * Adjust ordering to comply with tests
This commit is contained in:
committed by
GitHub
parent
37ceae0812
commit
7944e2bd2d
@@ -409,10 +409,11 @@ export class MongoStorageAdapter {
|
||||
distinct(className, schema, query, fieldName) {
|
||||
schema = convertParseSchemaToMongoSchema(schema);
|
||||
return this._adaptiveCollection(className)
|
||||
.then(collection => collection.distinct(fieldName, transformWhere(className, query, schema)));
|
||||
.then(collection => collection.distinct(fieldName, transformWhere(className, query, schema)))
|
||||
.then(objects => objects.map(object => mongoObjectToParseObject(className, object, schema)));
|
||||
}
|
||||
|
||||
aggregate(className, pipeline, readPreference) {
|
||||
aggregate(className, schema, pipeline, readPreference) {
|
||||
readPreference = this._parseReadPreference(readPreference);
|
||||
return this._adaptiveCollection(className)
|
||||
.then(collection => collection.aggregate(pipeline, { readPreference, maxTimeMS: this._maxTimeMS }))
|
||||
@@ -424,7 +425,8 @@ export class MongoStorageAdapter {
|
||||
}
|
||||
});
|
||||
return results;
|
||||
});
|
||||
})
|
||||
.then(objects => objects.map(object => mongoObjectToParseObject(className, object, schema)));
|
||||
}
|
||||
|
||||
_parseReadPreference(readPreference) {
|
||||
|
||||
Reference in New Issue
Block a user