intersection
Return a query that represents the intersection of two queries.
queryLogic.intersection(a, b)
Returns a query that represents the intersection of queries A and B. In set theory, an intersection is
represented by A ∩ B
.
import {QueryLogic} from "can";
const queryLogic = new QueryLogic();
const filter = queryLogic.intersection(
{ filter: {completed: true, due: "tomorrow"} },
{ filter: {completed: true, type: "critical"} }
);
console.log( filter ); //-> {filter: {completed: true, due: "tomorrow", type: "critical"}}
Returns
{Query}
:
Returns a query object, or one of the special sets:
- EMPTY - Query
a
is disjoint with queryb
. - 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.