Expand description
Evaluation of MetadataFilter (nodedb-types) against a document.
One evaluator serves every document shape: a field lookup closure resolves top-level fields. Adapters cover JSON documents (shape sync, vector post-filter), field maps (Lite edge properties) and plain-msgpack maps (Origin edge properties).
Semantics:
Eqon a missing field matches only aNullvalue.NenegatesEq.Gt/Gte/Lt/Lteare false when the field is missing or null, the value is null, or the pair has no order.Inon a missing field is false.NotInon a missing field is true.And([])is true.Or([])is false.
Coercion, one rule for equality and order:
- Numeric: numbers, decimals, numeric strings and bools (
true= 1) compare as numbers. Integer pairs compare exactly. - Instant: a typed instant compares with an instant or an ISO-8601 string by epoch microseconds.
- Text: strings, UUIDs and ULIDs order lexicographically.
- Any other pair of different kinds is unequal and has no order. So
{"score": "n/a"}failsscore > 5, and an array fails every order.
Enums§
- Property
MapError - A plain-msgpack property map the evaluator cannot read.
Functions§
- matches_
all_ fields - Every filter of
filtersagainst a field map. An empty list admits. - matches_
all_ msgpack - Every filter of
filtersagainst a plain-msgpack map. Decodes only the fields a filter names. Empty bytes evaluate as{}. An empty filter list admits without readingdoc. - matches_
metadata_ fields filteragainst a field map (Lite edge properties).- matches_
metadata_ filter filteragainst a JSON document (shape-sync predicates, vector post-filter).- matches_
metadata_ filter_ with - Evaluate
filteragainst a document whose top-level fieldslookupresolves. - try_
matches_ metadata_ filter_ with - Evaluate
filteragainst a document whose top-level fieldslookupresolves. A lookup error stops evaluation and returns that error.