httk.store.backend.mongo.stored_properties¶
Stored-property plans and exact query contexts for MongoDB.
The context builds the frozen neutral AST in httk.store.backend.mongo.evaluator.
MongoDB supplies a conservative candidate stream and the existing verified
iterator evaluates that AST over hydrated backing records.
Exceptions¶
A Mongo entry family cannot realize its stored-property declaration. |
Classes¶
An ID-only Mongo candidate stream for a configured concrete backing. |
|
Stored-property responses and verified Mongo candidate plans for one family. |
Functions¶
|
Validate and return the Mongo property plan for one configured logical family. |
Module Contents¶
- exception httk.store.backend.mongo.stored_properties.MongoStoredPropertyConfigurationError¶
Bases:
ValueErrorA Mongo entry family cannot realize its stored-property declaration.
- class httk.store.backend.mongo.stored_properties.MongoStoredPropertyCandidateStream¶
An ID-only Mongo candidate stream for a configured concrete backing.
- searcher: Any¶
- class httk.store.backend.mongo.stored_properties.MongoStoredPropertyPlan(store, family, layout, entry_type, definition, backings)¶
Stored-property responses and verified Mongo candidate plans for one family.
- records()¶
- filter_searchers(filter_string, *, sort=(), public_id_prefix='', as_of=None, only_latest=False, revisions=False, alternatives=False)¶
- candidate_searchers(filter_string=None, *, sort=(), public_id_prefix='', as_of=None, only_latest=False, revisions=False, alternatives=False)¶
- response_row(backing, record, *, public_id=None, httk_id=None, revisions=False, kind=None, store_timestamp=None, fields=None)¶
Render one hydrated backing record at the protocol boundary.
- Parameters:
backing (type) – The configured concrete record class.
record (object) – The hydrated backing record.
public_id (str | None) – The public id, or the record’s canonical id when omitted.
httk_id (str | None) – The plain group entry id rendered for
_httk_idwhen serving revisions or alternatives.revisions (bool) – Whether the row is served from a revision stream (synthesizes
_httk_id).kind (str | None) – The alternative kind rendered for
_httk_kindwhen serving alternatives, elseNone.store_timestamp (int | None) – An already-normalized candidate timestamp; otherwise the fallback lookup is used.
fields (collections.abc.Sequence[str] | None) – The response property names to render, or
Noneto render every configured property.
- Returns:
The protocol response row.
- Return type:
collections.abc.Mapping[str, Any]
Candidate/federation rows carry this value;
records()and entry-provider paths may use the fallback lookup.
- httk.store.backend.mongo.stored_properties.stored_property_mongo_plan(store, family, *, served=None)¶
Validate and return the Mongo property plan for one configured logical family.
The family’s internal definition establishes identity only (that the family and its records agree on one durable definition). Everything the plan then serves — the entry
type, the property set response and filter/sort validation run against, and the projection names backings must match — is taken fromserved: the OPTIMADE wire form of that definition (seeEntryTypeDefinition.served_form()). A prefixed family declares its__httk_stored_properties__projections under those served names, so it MUST be planned withserved=set; without it the bare internal definition rejects the prefixed projection keys as unknown. Whenservedis omitted the internal definition serves itself, which is byte-identical for standard (unprefixed) families.- Parameters:
store (Any) – The MongoStore containing the configured family.
family (type) – The logical entry-family class to validate.
served (httk.core.EntryTypeDefinition | None) – The served (wire) definition to serve, or
Nonefor the internal definition.
- Returns:
The validated Mongo property plan.
- Raises:
MongoStoredPropertyConfigurationError – If the family or any backing is inconsistent with its definition.
- Return type: