httk.store.backend.mongo.evaluator ================================== .. py:module:: httk.store.backend.mongo.evaluator .. autoapi-nested-parse:: 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 ------- .. autoapisummary:: httk.store.backend.mongo.evaluator.MongoScope httk.store.backend.mongo.evaluator.MongoValue httk.store.backend.mongo.evaluator.MongoPredicate Functions --------- .. autoapisummary:: httk.store.backend.mongo.evaluator.evaluate httk.store.backend.mongo.evaluator.canonical_predicate Module Contents --------------- .. py:class:: MongoScope A root, child, reference, or filtered record-object scope. .. py:attribute:: identifier :type: int .. py:attribute:: schema :type: httk.store.backend.schema.TableSchema .. py:attribute:: parent :type: MongoScope | None :value: None .. py:attribute:: relationship :type: httk.store.backend.schema.FieldSpec | None :value: None .. py:attribute:: filter_predicate :type: MongoPredicate | None :value: None .. py:attribute:: scalar_child :type: bool :value: False .. py:attribute:: context :type: Any :value: None .. py:method:: field(name) Select a scalar field from this scope. .. py:method:: scope(name) Follow one child or reference relationship from this scope. .. py:class:: MongoValue A field, aggregate, null, or literal value in the neutral AST. .. py:attribute:: kind :type: Literal['field', 'store_timestamp', 'logical_id', 'alt_kind', 'alternative_id', 'present', 'constant', 'null', 'count', 'distinct_count'] .. py:attribute:: scope :type: MongoScope | None :value: None .. py:attribute:: field :type: str | None :value: None .. py:attribute:: spec :type: httk.store.backend.schema.FieldSpec | None :value: None .. py:attribute:: literal :type: object .. py:attribute:: value :type: MongoValue | None :value: None .. py:class:: MongoPredicate A frozen three-valued predicate in the neutral stored-property AST. .. py:attribute:: kind :type: Literal['constant', 'compare', 'is_null', 'exists', 'and', 'or', 'not', 'when_known', 'scaled'] .. py:attribute:: operands :type: tuple[object, Ellipsis] :value: () .. py:function:: evaluate(predicate, record, store_timestamp_resolver = None, logical_id_resolver = None, alt_kind_resolver = None) Evaluate ``predicate`` exactly over a hydrated backing object. :param predicate: Frozen predicate produced by ``_MongoQueryContext``. :param record: Hydrated backing record for the candidate SID. :param store_timestamp_resolver: Optional resolver for the candidate's store timestamp. :param logical_id_resolver: Optional resolver for the candidate's store-managed lineage id. :param alt_kind_resolver: Optional resolver for the candidate's store-managed alternative kind. :return: ``True``, ``False``, or ``None`` for SQL UNKNOWN. .. py:function:: canonical_predicate(predicate) Return canonical JSON used as the verifier identity and cursor input.