Skip to main content

Module write

Module write 

Source
Expand description

The write body: decoding it, and lowering it onto the two write paths.

This is the 0.1.0 gap. Op was decoded correctly and the write path never called the decoder, so {"__op":"Increment","amount":1} was stored as a literal object with an __op key. The body is a map of parse_rust_core::FieldWrite end to end for that reason: a field is either a value or an operation, and “the write path forgot about operations” becomes a missing match arm rather than silence.

The two paths are genuinely different and upstream treats them so. A create flattens each operation to the value it would produce against an absent field (flattenUpdateOperatorsForCreate, DatabaseController.js:323-365); an update lowers each to a storage operation.

Functions§

as_plain_body
The body as plain values, for the checks that run against the raw REST body.
decode_write_body
Decode a JSON request body into fields and operations.
echo_response
Build the response body for a write, from the keys the request asked to echo and the row the adapter returned.
echoed_keys
The keys whose post-write value the response echoes back.
enforce_object_id_policy
allowCustomObjectId, on the create path only (RestWrite.js:50-65).
flatten_for_create
Flatten a write body onto the create path.
lower_update
Lower a write body onto the update path.

Type Aliases§

WriteBody
A decoded write body: ordered, because upstream field order is wire-visible.