pg support for null in containedAll (#4026)

This commit is contained in:
Diamond Lewis
2017-07-23 11:11:02 -05:00
committed by Florent Vilmart
parent 3c79cae1b2
commit 811d8b0c7a
2 changed files with 19 additions and 2 deletions

View File

@@ -301,8 +301,10 @@ const buildWhereClause = ({ schema, query, index }) => {
const inPatterns = [];
values.push(fieldName);
baseArray.forEach((listElem, listIndex) => {
values.push(listElem);
inPatterns.push(`$${index + 1 + listIndex}`);
if (listElem !== null) {
values.push(listElem);
inPatterns.push(`$${index + 1 + listIndex}`);
}
});
patterns.push(`$${index}:name ${not} IN (${inPatterns.join(',')})`);
index = index + 1 + inPatterns.length;