diff --git a/server/postgres/src/storage.ts b/server/postgres/src/storage.ts index 22c2664c15..833f8a3abb 100644 --- a/server/postgres/src/storage.ts +++ b/server/postgres/src/storage.ts @@ -1002,11 +1002,17 @@ abstract class PostgresAdapterBase implements DbAdapter { res.push(`${tkey} <= '${val}'`) break case '$in': - res.push( - type !== 'common' - ? `${tkey} ?| array[${val.length > 0 ? val.map((v: any) => `'${v}'`).join(', ') : 'NULL'}]` - : `${tkey} IN (${val.length > 0 ? val.map((v: any) => `'${v}'`).join(', ') : 'NULL'})` - ) + switch (type) { + case 'common': + res.push(`${tkey} IN (${val.length > 0 ? val.map((v: any) => `'${v}'`).join(', ') : 'NULL'})`) + break + case 'array': + res.push(`${tkey} && array[${val.length > 0 ? val.map((v: any) => `'${v}'`).join(', ') : 'NULL'}]`) + break + case 'dataArray': + res.push(`${tkey} ?| array[${val.length > 0 ? val.map((v: any) => `'${v}'`).join(', ') : 'NULL'}]`) + break + } break case '$nin': if (val.length > 0) {