Expand description
Parsing the where parameter.
A where value is {"field": <literal>} for equality, or {"field": {"$op": <value>}} for
everything else. An operator document may carry several operators, which is how a range is
expressed. $or, $and, $nor and $relatedTo are query-level keys rather than field names.
Anything unsupported is an error. Silently ignoring an operator returns more rows than the caller asked for, which is an authorization failure rather than a missing feature, and it is the failure mode this rule exists to prevent. The vocabulary grew at 0.2.0; the rule did not relax.
The output is a ParsedWhere rather than a Query, because two constructs cannot be
lowered without reading the database: $relatedTo and a constraint on a Relation-typed
field are both join-table reads. They stay as nodes here and are resolved by
crate::relations once a schema and a caller are known.
Structs§
- Parsed
Where - A parsed
wheredocument: a conjunction of clauses.
Enums§
- Parsed
Clause - One element of a parsed
where.
Constants§
- CLIENT_
QUERYABLE_ INTERNAL_ FIELDS - Internal columns a client may name in a query (
clientRead,DatabaseController.js:31-44). - MASTER_
QUERYABLE_ INTERNAL_ FIELDS - Internal columns the master key may additionally name (
masterRead). - MAX_
INCLUDE_ DEPTH - The deepest pointer chain an
includemay name. Seeparse_include. - MAX_
INCLUDE_ PATHS - The most distinct include paths one request may produce, counting expanded prefixes.
See
parse_include.
Functions§
- parse_
include - Parse the
includeparameter into paths, every prefix materialized and sorted by depth. - parse_
where - Parse a decoded
whereobject. - validate_
query_ keys - The key-name half of
validateQuery(DatabaseController.js:161-188).