filternodes

filter.nodes.range

range(spec: RangeSpec): FilterHandle<RangeSpec>

Numeric range filter on a node property.

Hides nodes whose property value falls outside [min, max]. Omitted bounds default to -Infinity / +Infinity. on restricts the filter to a subset of categories (default = all).

spec.propertystringNode property name to filter on.
spec.min numberLower bound (inclusive). Default: -Infinity.
spec.max numberUpper bound (inclusive). Default: +Infinity.
spec.on string | string[] | '*'Restrict to a subset of node categories. Default: '*' (all).
spec.includeNull booleanKeep nodes missing the property. Default: true.
spec.invert booleanInvert pass/fail. Default: false.
spec.id stringOverride the auto-generated handle id.

Returns: FilterHandle<RangeSpec>

Example

const adults = api.filter.nodes.range({
  property: "age",
  min: 18,
  on: "Person",
});

// later — tighten the lower bound
adults.update({ min: 21 });

// remove
adults.remove();