pub struct Lookup {
pub from: String,
pub local_field: Option<String>,
pub foreign_field: Option<String>,
pub as_field: String,
pub pipeline: Option<Vec<Value>>,
pub let_vars: Option<Map<String, Value>>,
}Expand description
A $lookup stage for MongoDB aggregation pipelines.
Fields§
§from: StringThe foreign collection.
local_field: Option<String>Local field to match.
foreign_field: Option<String>Foreign field to match.
as_field: StringOutput array field name.
pipeline: Option<Vec<Value>>Pipeline to run on matched documents.
let_vars: Option<Map<String, Value>>Variables to pass to pipeline.
Implementations§
Source§impl Lookup
impl Lookup
Sourcepub fn simple(
from: impl Into<String>,
local: impl Into<String>,
foreign: impl Into<String>,
as_field: impl Into<String>,
) -> Self
pub fn simple( from: impl Into<String>, local: impl Into<String>, foreign: impl Into<String>, as_field: impl Into<String>, ) -> Self
Create a simple $lookup (equality match).
Sourcepub fn with_pipeline(
from: impl Into<String>,
as_field: impl Into<String>,
) -> LookupBuilder
pub fn with_pipeline( from: impl Into<String>, as_field: impl Into<String>, ) -> LookupBuilder
Create a $lookup with pipeline (subquery).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Lookup
impl<'de> Deserialize<'de> for Lookup
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 Lookup
Auto Trait Implementations§
impl Freeze for Lookup
impl RefUnwindSafe for Lookup
impl Send for Lookup
impl Sync for Lookup
impl Unpin for Lookup
impl UnwindSafe for Lookup
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