You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the JsonContains find operator in TypeORM only accepts objects (Record<string | number | symbol, unknown>). This makes it impossible to query JSONB columns that store arrays in PostgreSQL.
Postgres supports @> containment checks for arrays, e.g.:
SELECT *
FROM my_table
WHERE my_jsonb_column @> '[{"id":"connection_id","value":"1"}]';
I'd like to take this. The fix should be straightforward — removing the Record constraint on JsonContains's generic to match the pattern used by ArrayContains and other operators. The existing test in #9381 already exercises array containment with an as any cast, confirming the runtime works fine.
Activity
PreAgile commentedon Apr 1, 2026
I'd like to take this. The fix should be straightforward — removing the
Recordconstraint onJsonContains's generic to match the pattern used byArrayContainsand other operators. The existing test in #9381 already exercises array containment with anas anycast, confirming the runtime works fine.fix(find-options): allow array values in JsonContains
docs(find-options): add JsonContains array example
test(find-options): cover primitive array containment in JsonContains
fix(query-builder): serialize jsonContains parameter values
test(find-options): enable cockroachdb for JsonContains suite