If true (default), any array or Set values in the target object's O(bject) position will be matched componentwise rather than matched as array value themselves.
Array or Set terms in S(ubject) or P(redicate) position are of course ALWAYS matched in a componentwise manner.
import { defQuery } from "@thi.ng/oquery";
const DB = { a: { knows: ["b","c"] }, b: { knows: ["a","c"] }};
defQuery({ cwise: true })(DB, null, "knows", "b")
// { a: { knows: ["b","c"] } }
defQuery({ cwise: false })(DB, null, "knows", (x) => x.includes("b"))
// { a: { knows: ["b","c"] } }
true
Equality predicate applied for matching literals in O(bject) position.
thi.ng/equiv#equiv
Only used if cwise
is enabled. If true, ALL of the query elements must match (aka intersection query). If false (default), an array or Set query term in O(bject) position will succeed if at least ONE of its elements is matched (aka union query). .
false
If false (default), an entire object is included in the solution as soon as any of its P(redicate)-O(bject) terms matches. If true, only the successfully matched property values will be included for each result.
import { defQuery } from "@thi.ng/oquery";
const DB = { a: { id: 1, name: "alice" }, b: { name: "bob" } };
defQuery({ partial: false })(DB, null, "id", 1)
// { a: { id: 1, name: "alice" } }
defQuery({ partial: true })(DB, null, "id", 1)
// { a: { id: 1 } }
false
Generated using TypeDoc
Query behavior options.