Fix: aggregate not matching null values (#6043)

* Fix: aggregate not matching null values

* Exclude Postgres from this new test - it does not even support  and  is not working correctly - should be addressed separately
This commit is contained in:
Antonio Davi Macedo Coelho de Castro
2019-09-11 07:13:15 -07:00
committed by Diamond Lewis
parent a754b883b2
commit 84776810b8
2 changed files with 49 additions and 1 deletions

View File

@@ -841,7 +841,9 @@ export class MongoStorageAdapter implements StorageAdapter {
// As much as I hate recursion...this seemed like a good fit for it. We're essentially traversing
// down a tree to find a "leaf node" and checking to see if it needs to be converted.
_parseAggregateArgs(schema: any, pipeline: any): any {
if (Array.isArray(pipeline)) {
if (pipeline === null) {
return null;
} else if (Array.isArray(pipeline)) {
return pipeline.map(value => this._parseAggregateArgs(schema, value));
} else if (typeof pipeline === 'object') {
const returnValue = {};