httk.store.backend.mongo.evaluator¶
Exact three-valued evaluation for Mongo stored-property predicates.
The Mongo query path deliberately evaluates this small, frozen AST over
hydrated records. That is important for child records: document storage keeps
their content-addressed SID links, while MongoStore.fetch gives the
evaluator their exact Python values.
Classes¶
A root, child, reference, or filtered record-object scope. |
|
A field, aggregate, null, or literal value in the neutral AST. |
|
A frozen three-valued predicate in the neutral stored-property AST. |
Functions¶
|
Evaluate |
|
Return canonical JSON used as the verifier identity and cursor input. |
Module Contents¶
- class httk.store.backend.mongo.evaluator.MongoScope¶
A root, child, reference, or filtered record-object scope.
- parent: MongoScope | None = None¶
- relationship: httk.store.backend.schema.FieldSpec | None = None¶
- filter_predicate: MongoPredicate | None = None¶
- context: Any = None¶
- field(name)¶
Select a scalar field from this scope.
- scope(name)¶
Follow one child or reference relationship from this scope.
- class httk.store.backend.mongo.evaluator.MongoValue¶
A field, aggregate, null, or literal value in the neutral AST.
- kind: Literal['field', 'store_timestamp', 'logical_id', 'alt_kind', 'alternative_id', 'present', 'constant', 'null', 'count', 'distinct_count']¶
- scope: MongoScope | None = None¶
- spec: httk.store.backend.schema.FieldSpec | None = None¶
- value: MongoValue | None = None¶
- class httk.store.backend.mongo.evaluator.MongoPredicate¶
A frozen three-valued predicate in the neutral stored-property AST.
- kind: Literal['constant', 'compare', 'is_null', 'exists', 'and', 'or', 'not', 'when_known', 'scaled']¶
- httk.store.backend.mongo.evaluator.evaluate(predicate, record, store_timestamp_resolver=None, logical_id_resolver=None, alt_kind_resolver=None)¶
Evaluate
predicateexactly over a hydrated backing object.- Parameters:
predicate (MongoPredicate) – Frozen predicate produced by
_MongoQueryContext.record (object) – Hydrated backing record for the candidate SID.
store_timestamp_resolver (collections.abc.Callable[[], object] | None) – Optional resolver for the candidate’s store timestamp.
logical_id_resolver (collections.abc.Callable[[], object] | None) – Optional resolver for the candidate’s store-managed lineage id.
alt_kind_resolver (collections.abc.Callable[[], object] | None) – Optional resolver for the candidate’s store-managed alternative kind.
- Returns:
True,False, orNonefor SQL UNKNOWN.- Return type:
bool | None
- httk.store.backend.mongo.evaluator.canonical_predicate(predicate)¶
Return canonical JSON used as the verifier identity and cursor input.