filteredges

filter.edges.match

match(spec: MatchSpec): FilterHandle<MatchSpec>

Categorical (allowlist) filter on an edge property.

Hides edges whose property value is not in oneOf. When regex is provided, it takes precedence over oneOf.

property: "relationship" is remapped internally to match edge.relationship (the top-level field). Similarly property: "id" maps to edge.id. Any other value selects from edge.properties.

spec.propertystringEdge property name. Special-cases 'relationship' and 'id' to top-level fields.
spec.oneOf string[] | Set<string>Allowlist of values that pass the filter.
spec.regex RegExpRegex to match the property value. Takes precedence over oneOf.
spec.on string | string[] | '*'Restrict to a subset of edge relationships. Default: '*' (all).
spec.includeNull booleanKeep edges missing the property. Default: true.
spec.invert booleanInvert pass/fail. Default: false.
spec.id stringOverride the auto-generated handle id.

Returns: FilterHandle<MatchSpec>

Examples

// Keep only WORKS_AT and FOUNDED edges
const employmentLinks = api.filter.edges.match({
  property: "relationship",
  oneOf: ["WORKS_AT", "FOUNDED"],
});