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.property | string | Edge 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 | RegExp | Regex to match the property value. Takes precedence over oneOf. |
spec.on | string | string[] | '*' | Restrict to a subset of edge relationships. Default: '*' (all). |
spec.includeNull | boolean | Keep edges missing the property. Default: true. |
spec.invert | boolean | Invert pass/fail. Default: false. |
spec.id | string | Override 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"],
});