mungo/aggregation

for more information, see here

Types

pub type AggregateOption {
  BatchSize(Int)
  Let(List(#(String, bson.Value)))
}

Constructors

  • BatchSize(Int)
  • Let(List(#(String, bson.Value)))
pub opaque type Pipeline

Functions

pub fn add_fields(
  pipeline: Pipeline,
  doc: List(#(String, Value)),
) -> Pipeline
pub fn aggregate(
  collection: Collection,
  options: List(AggregateOption),
  timeout: Int,
) -> Pipeline
pub fn append_stage(
  pipeline: Pipeline,
  stage: #(String, Value),
) -> Pipeline
pub fn group(
  pipeline: Pipeline,
  doc: List(#(String, Value)),
) -> Pipeline
pub fn limit(pipeline: Pipeline, count: Int) -> Pipeline
pub fn lookup(
  pipeline: Pipeline,
  from from: String,
  local_field local_field: String,
  foreign_field foreign_field: String,
  alias alias: String,
) -> Pipeline

for more information, see here

pub fn match(
  pipeline: Pipeline,
  doc: List(#(String, Value)),
) -> Pipeline
pub fn pipelined_lookup(
  pipeline: Pipeline,
  from from: String,
  define definitions: List(#(String, Value)),
  pipeline lookup_pipeline: List(List(#(String, Value))),
  alias alias: String,
) -> Pipeline

for more information, see here

pub fn project(
  pipeline: Pipeline,
  doc: List(#(String, Value)),
) -> Pipeline
pub fn skip(pipeline: Pipeline, count: Int) -> Pipeline
pub fn sort(
  pipeline: Pipeline,
  doc: List(#(String, Value)),
) -> Pipeline
pub fn to_cursor(pipeline: Pipeline) -> Result(Cursor, Error)
pub fn unwind(
  pipeline: Pipeline,
  path: String,
  preserve_null_and_empty_arrays: Bool,
) -> Pipeline
pub fn unwind_with_index(
  pipeline: Pipeline,
  path: String,
  index_field: String,
  preserve_null_and_empty_arrays: Bool,
) -> Pipeline
Search Document