* Adds error reproduction * Fix transform in order to accept nested array results in $in/$nin The error originated by the nesting of 2 array in $in [["..."]], using _.flatMap with those will guarantee at the lower level that the query is properly resolved * nits * _.flatMap the $in/$nin values
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { createClient } from './PostgresClient';
|
||||
import Parse from 'parse/node';
|
||||
import _ from 'lodash';
|
||||
|
||||
const PostgresRelationDoesNotExistError = '42P01';
|
||||
const PostgresDuplicateRelationError = '42P07';
|
||||
@@ -296,10 +297,10 @@ const buildWhereClause = ({ schema, query, index }) => {
|
||||
}
|
||||
}
|
||||
if (fieldValue.$in) {
|
||||
createConstraint(fieldValue.$in, false);
|
||||
createConstraint(_.flatMap(fieldValue.$in, elt => elt), false);
|
||||
}
|
||||
if (fieldValue.$nin) {
|
||||
createConstraint(fieldValue.$nin, true);
|
||||
createConstraint(_.flatMap(fieldValue.$nin, elt => elt), true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user