filter.any
any(children: FilterHandle<unknown>[], opts?: GroupOptions): FilterHandleOR-compose existing filter handles into a single group. The original handles are detached from the manager; only the group evaluates against the data. See GroupOptions.cleanupChildren for the removal semantics.
children | FilterHandle<unknown>[] | |
opts | GroupOptions |
Returns: FilterHandle
Example
const youngPeople = api.filter.nodes.range({ property: "age", max: 25 });
const oldPeople = api.filter.nodes.range({ property: "age", min: 65 });
// Keep nodes that pass EITHER filter
const nonMiddleAged = api.filter.any([youngPeople, oldPeople]);
All children must share the same target ("nodes" or "edges"). Mixing
targets throws.
The returned group handle's remove() honours GroupOptions.cleanupChildren:
true(default) — children stay gone after the group is removed.false— children are re-registered as independent filters so they keep filtering on their own after the group is removed.