pub enum ArrayOp {
Push {
field: String,
value: Value,
position: Option<i32>,
},
PushAll {
field: String,
values: Vec<Value>,
},
Pull {
field: String,
value: Value,
},
PullAll {
field: String,
values: Vec<Value>,
},
AddToSet {
field: String,
value: Value,
},
AddToSetAll {
field: String,
values: Vec<Value>,
},
Pop {
field: String,
first: bool,
},
}Expand description
MongoDB array update operators.
Variants§
Push
Push element to array ($push).
PushAll
Push all elements ($push with $each).
Pull
Pull element from array ($pull).
PullAll
Pull all matching elements ($pullAll).
AddToSet
Add to set if not exists ($addToSet).
AddToSetAll
Add all to set ($addToSet with $each).
Pop
Remove first or last element ($pop).
Implementations§
Source§impl ArrayOp
impl ArrayOp
Sourcepub fn push(field: impl Into<String>, value: impl Into<JsonValue>) -> Self
pub fn push(field: impl Into<String>, value: impl Into<JsonValue>) -> Self
Create a $push operation.
Sourcepub fn pull(field: impl Into<String>, value: impl Into<JsonValue>) -> Self
pub fn pull(field: impl Into<String>, value: impl Into<JsonValue>) -> Self
Create a $pull operation.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ArrayOp
impl<'de> Deserialize<'de> for ArrayOp
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for ArrayOp
Auto Trait Implementations§
impl Freeze for ArrayOp
impl RefUnwindSafe for ArrayOp
impl Send for ArrayOp
impl Sync for ArrayOp
impl Unpin for ArrayOp
impl UnwindSafe for ArrayOp
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more