union
Perform a union of two queries.
queryLogic.union(queryA, queryB)
Returns a query that represents the union queryA
and queryB
. In set theory, a union is
represented by A ∪ B
.
import {QueryLogic} from "can";
const queryLogic = new QueryLogic();
const myUnion = queryLogic.union(
{ filter: {completed: true} },
{ filter: {completed: false} }
);
// using JSON.stringify to show full object on codepen
console.log( JSON.stringify(myUnion) ); //-> "{ filter: {completed: {$in: [true, false]}} }"
Returns
{Query}
:
Returns a query object, or one of the special sets:
- UNDEFINABLE - An intersection exists, but it can not be represented with the current logic.
- UNKNOWABLE - The logic is unable to determine if an intersection exists or not.