Expand description
Relations: the join tables, and the query constructs that read them.
A Relation field has no column. It is skipped on write, stored as relation<Target> in
_SCHEMA, and synthesized from the schema on read. Membership lives in
_Join:<key>:<className> as documents of exactly {relatedId, owningId}
(DatabaseController.js:319-321, :418-420, :794-830), and those collections have no
_SCHEMA row at all. parse_rust_storage::join_schema builds the shape in memory for that
reason: writing a schema row for a join table would add a class every parse-server node
reading the same database would then see.
The writes here are not atomic with the parent write. The row write, the join upsert and the schema reservation are three operations, and without transactions any of them can fail independently, leaving a membership recorded against a row that was never written or a row written without its membership. Upstream has the same exposure on a non-replica-set deployment. It is stated here rather than left to be discovered.
Structs§
- Relation
Update - One pending membership change, stripped out of a write body.
Enums§
- Related
ToOutcome - What a
$relatedToresolved to. - Relation
Constraint - Which reverse-join read a constraint on a
Relation-typed field asks for. - Relation
OpKind
Functions§
- add_
in_ object_ ids - Intersect an
objectId $ininto a query.addInObjectIdsIds(DatabaseController.js:1310-1345). - add_
not_ in_ object_ ids - Union an
objectId $nininto a query.addNotInObjectIdsIds(DatabaseController.js:1347-1372). - apply_
relation_ updates - Apply membership changes, after the row write has succeeded.
- authorize_
related_ to authorizeRelatedToQuery(DatabaseController.js:1260-1308), run before the join table is read.- collect_
relation_ updates - Strip
AddRelationandRemoveRelationout of a write body, including inside aBatch. - owning_
ids - The owning objectIds that relate to any of these ids.
owningIds(DatabaseController.js:1036-1045). - related_
ids - The related objectIds of one owning object.
relatedIds(DatabaseController.js:1015-1032). - relation_
constraints_ for - Read every constraint on one
Relation-typed field, as one group.