pub enum UpdateValue {
SetOnInsert(ParseValue),
Set(ParseValue),
Increment(f64),
Add(Vec<ParseValue>),
AddUnique(Vec<ParseValue>),
Remove(Vec<ParseValue>),
Unset,
}Expand description
What one field of an update does.
0.1.0 modelled an update as a row of literal values, which is why {"__op":"Increment"}
round-tripped into storage as an object with an __op key. Modelling the op set explicitly
makes “the adapter forgot to handle Increment” a missing match arm.
Variants§
SetOnInsert(ParseValue)
$setOnInsert: set the field only if this operation inserts the row
(MongoTransform.js:993-998).
Carried because upstream carries it, not because a REST write can produce one:
getObjectType has no arm for SetOnInsert and throws before the write path is reached
(SchemaController.js:1652-1653). See infer_op_type.
Set(ParseValue)
Replace the field.
Increment(f64)
$inc.
Add(Vec<ParseValue>)
$push with $each. Duplicates allowed.
AddUnique(Vec<ParseValue>)
$addToSet with $each.
Remove(Vec<ParseValue>)
$pullAll. Note the shape difference from Add: no $each wrapper
(MongoTransform.js:1024-1029).
Unset
$unset.
Implementations§
Source§impl UpdateValue
impl UpdateValue
Sourcepub fn echoes_result(&self) -> bool
pub fn echoes_result(&self) -> bool
Does applying this need the post-image read back?
Only ops do. A Set tells the client nothing it did not already know, which is why
_sanitizeDatabaseResult returns only op keys (DatabaseController.js:2129-2157).
Trait Implementations§
Source§impl Clone for UpdateValue
impl Clone for UpdateValue
Source§fn clone(&self) -> UpdateValue
fn clone(&self) -> UpdateValue
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more