aggregate

package
v0.0.0-...-6524a5b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Limit

func Limit(num int) func(bson.A) bson.A

The Limit function builds the $limit operator into a pipeline

func Lookup

func Lookup(from string, localField string, foreignField string, as string) func(bson.A) bson.A

The Lookup function builds the $lookup operator into a pipeline

func Match

func Match(fields Operation) func(bson.A) (a bson.A)

The Match function builds the $match operator into a pipeline

func Pipe

func Pipe(pipeline bson.A, steps ...func(bson.A) bson.A) bson.A

The Pipe functions similar to the RxJS pipe function (https://rxjs-dev.firebaseapp.com/api/index/function/pipe) in that it accepts a set of functions as parameters. Each function receives as its input, the output of the previous function. The allows you to chain together functions that have the same bson.A signature and create elaborate aggregate pipelines that get injected into the MongoDB driver. The Pipe function accepts an initial state as its first parameter.

func Project

func Project(fields Operation) func(bson.A) bson.A

The Project function builds the $project operator into a pipeline

func ReplaceRoot

func ReplaceRoot(fields Operation) func(bson.A) bson.A

The Project function builds the $project operator into a pipeline

func Skip

func Skip(num int) func(bson.A) bson.A

The Skip function builds the $skip operator into a pipeline

func Sort

func Sort(fields Operation) func(bson.A) bson.A

The Sort function builds the $sort operator into a pipeline

func Unwind

func Unwind(fields Operation) func(bson.A) bson.A

The Unwind function builds the $unwind operator into a pipeline

func UnwindSingle

func UnwindSingle(field string) func(bson.A) bson.A

The UnwindSingle function builds the $unwind operator into a pipeline

Types

type Operation

type Operation bson.M

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL