function unionWherePredicates(predicates): BasicExpression<boolean>;
function unionWherePredicates(predicates): BasicExpression<boolean>;
Defined in: packages/db/src/query/predicate-utils.ts:295
Combine multiple where predicates with OR logic (union). Returns a predicate that is satisfied when any input predicate is satisfied. Simplifies when possible (e.g., age > 10 OR age > 20 → age > 10).
BasicExpression<boolean>[]
Array of where predicates to union
BasicExpression<boolean>
Combined predicate representing the union
// Take least restrictive
unionWherePredicates([gt(ref('age'), val(10)), gt(ref('age'), val(20))]) // age > 10
// Take least restrictive
unionWherePredicates([gt(ref('age'), val(10)), gt(ref('age'), val(20))]) // age > 10
// Combine equals into IN
unionWherePredicates([eq(ref('age'), val(5)), eq(ref('age'), val(10))]) // age IN [5, 10]
// Combine equals into IN
unionWherePredicates([eq(ref('age'), val(5)), eq(ref('age'), val(10))]) // age IN [5, 10]
Your weekly dose of JavaScript news. Delivered every Monday to over 100,000 devs, for free.
Your weekly dose of JavaScript news. Delivered every Monday to over 100,000 devs, for free.
