pub struct SetWindowFieldsBuilder { /* private fields */ }Expand description
Builder for $setWindowFields.
Implementations§
Source§impl SetWindowFieldsBuilder
impl SetWindowFieldsBuilder
Sourcepub fn partition_by(self, expr: impl Into<String>) -> Self
pub fn partition_by(self, expr: impl Into<String>) -> Self
Set PARTITION BY.
Sourcepub fn partition_by_expr(self, expr: JsonValue) -> Self
pub fn partition_by_expr(self, expr: JsonValue) -> Self
Set PARTITION BY with object expression.
Sourcepub fn sort_by_desc(self, field: impl Into<String>) -> Self
pub fn sort_by_desc(self, field: impl Into<String>) -> Self
Set SORT BY with direction.
Sourcepub fn sort_by_fields(self, fields: Vec<(&str, i32)>) -> Self
pub fn sort_by_fields(self, fields: Vec<(&str, i32)>) -> Self
Set SORT BY with multiple fields.
Sourcepub fn row_number(self, output_field: impl Into<String>) -> Self
pub fn row_number(self, output_field: impl Into<String>) -> Self
Add $rowNumber output field.
Sourcepub fn dense_rank(self, output_field: impl Into<String>) -> Self
pub fn dense_rank(self, output_field: impl Into<String>) -> Self
Add $denseRank output field.
Sourcepub fn sum(
self,
output_field: impl Into<String>,
input: impl Into<String>,
window: Option<MongoWindow>,
) -> Self
pub fn sum( self, output_field: impl Into<String>, input: impl Into<String>, window: Option<MongoWindow>, ) -> Self
Add $sum with window output field.
Sourcepub fn avg(
self,
output_field: impl Into<String>,
input: impl Into<String>,
window: Option<MongoWindow>,
) -> Self
pub fn avg( self, output_field: impl Into<String>, input: impl Into<String>, window: Option<MongoWindow>, ) -> Self
Add $avg with window output field.
Sourcepub fn first(
self,
output_field: impl Into<String>,
input: impl Into<String>,
) -> Self
pub fn first( self, output_field: impl Into<String>, input: impl Into<String>, ) -> Self
Add $first output field.
Sourcepub fn last(
self,
output_field: impl Into<String>,
input: impl Into<String>,
) -> Self
pub fn last( self, output_field: impl Into<String>, input: impl Into<String>, ) -> Self
Add $last output field.
Sourcepub fn shift(
self,
output_field: impl Into<String>,
output: impl Into<String>,
by: i32,
default: Option<JsonValue>,
) -> Self
pub fn shift( self, output_field: impl Into<String>, output: impl Into<String>, by: i32, default: Option<JsonValue>, ) -> Self
Add $shift (LAG/LEAD equivalent) output field.
Sourcepub fn output(self, field: impl Into<String>, spec: JsonValue) -> Self
pub fn output(self, field: impl Into<String>, spec: JsonValue) -> Self
Add custom window function.
Sourcepub fn build(self) -> SetWindowFields
pub fn build(self) -> SetWindowFields
Build the stage.
Trait Implementations§
Source§impl Clone for SetWindowFieldsBuilder
impl Clone for SetWindowFieldsBuilder
Source§fn clone(&self) -> SetWindowFieldsBuilder
fn clone(&self) -> SetWindowFieldsBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SetWindowFieldsBuilder
impl Debug for SetWindowFieldsBuilder
Source§impl Default for SetWindowFieldsBuilder
impl Default for SetWindowFieldsBuilder
Source§fn default() -> SetWindowFieldsBuilder
fn default() -> SetWindowFieldsBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SetWindowFieldsBuilder
impl RefUnwindSafe for SetWindowFieldsBuilder
impl Send for SetWindowFieldsBuilder
impl Sync for SetWindowFieldsBuilder
impl Unpin for SetWindowFieldsBuilder
impl UnwindSafe for SetWindowFieldsBuilder
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