Skip to main content

Module document

Module document 

Source
Expand description

Native RushDB query-document parser.

Accepts the database query-document shape and lowers it onto the shared Expr/RelatedExpr execution model:

{ "labels": ["..."], "where": { "status": {"$in": [...]} },
  "select": {...}, "groupBy": [...], "orderBy": {...}, "limit": 10, "skip": 0 }

where supports flat-key implicit $and, $eq/$ne/$gt/$gte/$lt/$lte/ $in/$nin/$contains/$startsWith/$endsWith/$exists/$type, logical $and/$or/$nor/$xor/$not, $id, label-key relationship blocks with $alias, $relation (type + direction + hops), $cycle, and nested multi-level blocks.

Structs§

ParsedQuery
Full query document lowered onto the execution model. Also exposes whether the query is a listing (no groupBy) or aggregate (groupBy or select with metrics).

Enums§

QueryDocumentError
Errors produced while lowering a query document.

Functions§

collect_alias_map
Collect every traversal alias (and nested aliases) reachable in a where expression, recording the full path from the root to each alias level.
parse_document
Parse a complete query document into its execution model.
parse_select
Parse a select object into aggregate request metrics. select value forms: "$record.field", "$alias", "$alias.field", {"$count": "*" | "$alias" | "$alias.field"}, {"$sum": "$record.field"}, {"$avg": ...}, {"$min": ...}, {"$max": ...}.
parse_where
Parse a documented where object into a root Expr (with Related nodes for traversal blocks). Flat keys become implicit $and conjuncts.

Type Aliases§

CollectAliasMap
Alias → full traversal path (each level’s labels/rel-type/direction plus that level’s where predicates), resolved from the where clause so alias-based $collect.from reuses a declared traversal alias. Multi-hop aliases keep every step; alias $count/$sum share the same shape.