fix potential issue with setting geoNear.query to undefined (#6696)
* add test cases for geoNear aggregation Test cases do not have the `query` parameter set in $geoNear aggregation stage. this is to test for a reported potential issue when the parameter is not set. * fixed potential issue when setting the geoNear.query parameter to undefined see dicussion in https://github.com/parse-community/parse-server/pull/6540 * fixed duplicate index name in test
This commit is contained in:
@@ -860,7 +860,7 @@ export class MongoStorageAdapter implements StorageAdapter {
|
||||
stage.$project
|
||||
);
|
||||
}
|
||||
if (stage.$geoNear) {
|
||||
if (stage.$geoNear && stage.$geoNear.query) {
|
||||
stage.$geoNear.query = this._parseAggregateArgs(
|
||||
schema,
|
||||
stage.$geoNear.query
|
||||
|
||||
Reference in New Issue
Block a user