aggregation

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AbsOp                 = "$abs"
	AddOp                 = "$add"
	AndOp                 = "$and"
	ArrayElemAtOp         = "$arrayElemAt"
	ArrayToObjectOp       = "$arrayToObject"
	AsOp                  = "as"
	AvgOp                 = "$avg"
	BranchesOp            = "branches"
	CaseOp                = "case"
	CeilOp                = "$ceil"
	ConcatArraysOp        = "$concatArrays"
	ConcatOp              = "$concat"
	CondOp                = "$cond"
	CondWithoutOperatorOp = "cond"
	ContactOp             = "$concat"
	DateOp                = "date"
	DateToStringOp        = "$dateToString"
	DayOfMonthOp          = "$dayOfMonth"
	DayOfWeekOp           = "$dayOfWeek"
	DayOfYearOp           = "$dayOfYear"
	DefaultCaseOp         = "default"
	DivideOp              = "$divide"
	EqOp                  = "$eq"
	ExpOp                 = "$exp"
	FilterOp              = "$filter"
	FirstOp               = "$first"
	FloorOp               = "$floor"
	FormatOp              = "format"
	GtOp                  = "$gt"
	GteOp                 = "$gte"
	IfNullOp              = "$ifNull"
	InOp                  = "in"
	InputOp               = "input"
	LastOp                = "$last"
	LIMIT                 = "limit"
	LnOp                  = "$ln"
	Log10Op               = "$log10"
	LogOp                 = "$log"
	LtOp                  = "$lt"
	LteOp                 = "$lte"
	MapOp                 = "$map"
	MaxOp                 = "$max"
	MinOp                 = "$min"
	ModOp                 = "$mod"
	MonthOp               = "$month"
	MultiplyOp            = "$multiply"
	NeOp                  = "$ne"
	NotOp                 = "$not"
	OnNullOp              = "onNull"
	OrOp                  = "$or"
	PowOp                 = "$pow"
	PushOp                = "$push"
	RoundOp               = "$round"
	SizeOp                = "$size"
	SliceOp               = "$slice"
	SqrtOp                = "$sqrt"
	SubstrBytesOp         = "$substrBytes"
	SubtractOp            = "$subtract"
	SumOp                 = "$sum"
	SwitchOp              = "$switch"
	ThenOp                = "then"
	TimezoneOp            = "timezone"
	ToLowerOp             = "$toLower"
	ToUpperOp             = "$toUpper"
	TruncOp               = "$trunc"
	WeekOp                = "$week"
	YearOp                = "$year"
)
View Source
const (
	StageAddFieldsOp   = "$addFields"
	StageBoundariesOp  = "boundaries"
	StageBucketAutoOp  = "$bucketAuto"
	StageBucketOp      = "$bucket"
	StageBucketsOp     = "buckets"
	StageCountOp       = "$count"
	StageDefaultOp     = "default"
	StageFacetOp       = "$facet"
	StageGranularityOp = "granularity"
	StageGroupByOp     = "groupBy"
	StageGroupOp       = "$group"
	StageLimitOp       = "$limit"
	StageLookUpOp      = "$lookup"
	StageMatchOp       = "$match"
	StageOutputOp      = "output"
	StageProjectOp     = "$project"
	StageReplaceWithOp = "$replaceWith"
	StageSetOp         = "$set"
	StageSkipOp        = "$skip"
	StageSortByCountOp = "$sortByCount"
	StageSortOp        = "$sort"
	StageUnwindOp      = "$unwind"
)

Stages

Variables

This section is empty.

Functions

func Abs added in v1.1.0

func Abs(key string, expression any) bson.D

func Add added in v0.4.0

func Add(key string, expression ...any) bson.D

func AddWithoutKey added in v0.9.0

func AddWithoutKey(expression ...any) bson.D

func And added in v0.4.0

func And(key string, expressions ...any) bson.D

func AndWithoutKey added in v0.9.0

func AndWithoutKey(expressions ...any) bson.D

func ArrayElemAt added in v0.4.0

func ArrayElemAt(key string, expression any, index int64) bson.D

func ArrayElemAtWithoutKey added in v0.9.0

func ArrayElemAtWithoutKey(expression any, index int64) bson.D

func ArrayToObject added in v0.4.0

func ArrayToObject(key string, expression any) bson.D

func ArrayToObjectWithoutKey added in v0.9.0

func ArrayToObjectWithoutKey(expression any) bson.D

func Avg added in v0.4.0

func Avg(key string, expression any) bson.D

func AvgWithoutKey added in v0.9.0

func AvgWithoutKey(expression any) bson.D

func Ceil added in v1.1.0

func Ceil(key string, expression any) bson.D

func Concat added in v0.4.0

func Concat(key string, expressions ...any) bson.D

func ConcatArrays added in v0.4.0

func ConcatArrays(key string, arrays ...any) bson.D

func ConcatArraysWithoutKey added in v0.9.0

func ConcatArraysWithoutKey(arrays ...any) bson.D

func ConcatWithoutKey added in v0.9.0

func ConcatWithoutKey(expressions ...any) bson.D

func Cond added in v0.4.0

func Cond(key string, boolExpr, tureExpr, falseExpr any) bson.D

func CondWithoutKey added in v0.9.0

func CondWithoutKey(boolExpr, tureExpr, falseExpr any) bson.D

func Contact added in v0.4.0

func Contact(key string, expressions ...any) bson.D

func ContactWithoutKey added in v0.9.0

func ContactWithoutKey(expressions ...any) bson.D

func DateToString added in v0.4.0

func DateToString(key string, date any, opt *DateToStringOptions) bson.D

func DateToStringWithoutKey added in v0.9.0

func DateToStringWithoutKey(date any, opt *DateToStringOptions) bson.D

func DayOfMonth added in v0.4.0

func DayOfMonth(key string, date time.Time) bson.D

func DayOfMonthWithTimezone added in v0.4.0

func DayOfMonthWithTimezone(key string, date time.Time, timezone string) bson.D

func DayOfMonthWithTimezoneWithoutKey added in v0.9.0

func DayOfMonthWithTimezoneWithoutKey(date time.Time, timezone string) bson.D

func DayOfMonthWithoutKey added in v0.9.0

func DayOfMonthWithoutKey(date time.Time) bson.D

func DayOfWeek added in v0.4.0

func DayOfWeek(key string, date time.Time) bson.D

func DayOfWeekWithTimezone added in v0.4.0

func DayOfWeekWithTimezone(key string, date time.Time, timezone string) bson.D

func DayOfWeekWithTimezoneWithoutKey added in v0.9.0

func DayOfWeekWithTimezoneWithoutKey(date time.Time, timezone string) bson.D

func DayOfWeekWithoutKey added in v0.9.0

func DayOfWeekWithoutKey(date time.Time) bson.D

func DayOfYear added in v0.4.0

func DayOfYear(key string, date time.Time) bson.D

func DayOfYearWithTimezone added in v0.4.0

func DayOfYearWithTimezone(key string, date time.Time, timezone string) bson.D

func DayOfYearWithTimezoneWithoutKey added in v0.9.0

func DayOfYearWithTimezoneWithoutKey(date time.Time, timezone string) bson.D

func DayOfYearWithoutKey added in v0.9.0

func DayOfYearWithoutKey(date time.Time) bson.D

func Divide added in v0.4.0

func Divide(key string, expressions ...any) bson.D

func DivideWithoutKey added in v0.9.0

func DivideWithoutKey(expressions ...any) bson.D

func Eq added in v0.4.0

func Eq(key string, expressions ...any) bson.D

func EqWithoutKey added in v0.9.0

func EqWithoutKey(expressions ...any) bson.D

func Exp added in v1.1.0

func Exp(key string, exponent any) bson.D

func Filter added in v0.4.0

func Filter(key string, inputArray any, cond any, opt *FilterOptions) bson.D

func FilterWithoutKey added in v0.9.0

func FilterWithoutKey(inputArray any, cond any, opt *FilterOptions) bson.D

func First added in v0.4.0

func First(key string, expression any) bson.D

func FirstWithoutKey added in v0.9.0

func FirstWithoutKey(expression any) bson.D

func Floor added in v1.1.0

func Floor(key string, numberExpression any) bson.D

func Gt added in v0.4.0

func Gt(key string, expressions ...any) bson.D

func GtWithoutKey added in v0.9.0

func GtWithoutKey(expressions ...any) bson.D

func Gte added in v0.4.0

func Gte(key string, expressions ...any) bson.D

func GteWithoutKey added in v0.9.0

func GteWithoutKey(expressions ...any) bson.D

func IfNull added in v0.4.0

func IfNull(key string, expr, replacement any) bson.D

func IfNullWithoutKey added in v0.9.0

func IfNullWithoutKey(expr, replacement any) bson.D

func Last added in v0.4.0

func Last(key string, expression any) bson.D

func LastWithoutKey added in v0.9.0

func LastWithoutKey(expression any) bson.D

func Ln added in v1.1.0

func Ln(key string, numberExpression any) bson.D

func Log added in v1.1.0

func Log(key string, numberExpression, baseNumberExpression any) bson.D

func Log10 added in v1.1.0

func Log10(key string, numberExpression any) bson.D

func Lt added in v0.4.0

func Lt(key string, expressions ...any) bson.D

func LtWithoutKey added in v0.9.0

func LtWithoutKey(expressions ...any) bson.D

func Lte added in v0.4.0

func Lte(key string, expressions ...any) bson.D

func LteWithoutKey added in v0.9.0

func LteWithoutKey(expressions ...any) bson.D

func Map added in v0.4.0

func Map(key string, inputArray any, as string, in any) bson.D

func MapWithoutKey added in v0.9.0

func MapWithoutKey(inputArray any, as string, in any) bson.D

func Max added in v0.4.0

func Max(key string, expression any) bson.D

func MaxWithoutKey added in v0.9.0

func MaxWithoutKey(expression any) bson.D

func Min added in v0.4.0

func Min(key string, expression any) bson.D

func MinWithoutKey added in v0.9.0

func MinWithoutKey(expression any) bson.D

func Mod added in v0.4.0

func Mod(key string, expressions ...any) bson.D

func ModWithoutKey added in v0.9.0

func ModWithoutKey(expressions ...any) bson.D

func Month added in v0.4.0

func Month(key string, date time.Time) bson.D

func MonthWithTimezone added in v0.4.0

func MonthWithTimezone(key string, date time.Time, timezone string) bson.D

func MonthWithTimezoneWithoutKey added in v0.9.0

func MonthWithTimezoneWithoutKey(date time.Time, timezone string) bson.D

func MonthWithoutKey added in v0.9.0

func MonthWithoutKey(date time.Time) bson.D

func Multiply added in v0.4.0

func Multiply(key string, expressions ...any) bson.D

func MultiplyWithoutKey added in v0.9.0

func MultiplyWithoutKey(expressions ...any) bson.D

func Ne added in v0.4.0

func Ne(key string, expressions ...any) bson.D

func NeWithoutKey added in v0.9.0

func NeWithoutKey(expressions ...any) bson.D

func Not added in v0.4.0

func Not(key string, expressions ...any) bson.D

func NotWithoutKey added in v0.9.0

func NotWithoutKey(expressions ...any) bson.D

func Or added in v0.4.0

func Or(key string, expressions ...any) bson.D

func OrWithoutKey added in v0.9.0

func OrWithoutKey(expressions ...any) bson.D

func Pow added in v1.1.0

func Pow(key string, numberExpression, exponentExpression any) bson.D

func Push added in v0.4.0

func Push(key string, expression any) bson.D

func PushWithoutKey added in v0.9.0

func PushWithoutKey(expression any) bson.D

func Round added in v1.1.0

func Round(key string, numberExpression, placeExpression any) bson.D

func Size added in v0.4.0

func Size(key string, expression any) bson.D

func SizeWithoutKey added in v0.9.0

func SizeWithoutKey(expression any) bson.D

func Slice added in v0.4.0

func Slice(key string, array any, nElements int64) bson.D

func SliceWithPosition added in v0.4.0

func SliceWithPosition(key string, array any, position, nElements int64) bson.D

func SliceWithPositionWithoutKey added in v0.9.0

func SliceWithPositionWithoutKey(array any, position, nElements int64) bson.D

func SliceWithoutKey added in v0.9.0

func SliceWithoutKey(array any, nElements int64) bson.D

func Sqrt added in v1.1.0

func Sqrt(key string, numberExpression any) bson.D

func SubstrBytes added in v0.4.0

func SubstrBytes(key string, stringExpression string, byteIndex int64, byteCount int64) bson.D

func SubstrBytesWithoutKey added in v0.9.0

func SubstrBytesWithoutKey(stringExpression string, byteIndex int64, byteCount int64) bson.D

func Subtract added in v0.4.0

func Subtract(key string, expression ...any) bson.D

func SubtractWithoutKey added in v0.9.0

func SubtractWithoutKey(expressions ...any) bson.D

func Sum added in v0.4.0

func Sum(key string, expression any) bson.D

func SumWithoutKey added in v0.9.0

func SumWithoutKey(expression any) bson.D

func Switch added in v0.4.0

func Switch(key string, cases []CaseThen, defaultCase any) bson.D

func SwitchWithoutKey added in v0.9.0

func SwitchWithoutKey(cases []CaseThen, defaultCase any) bson.D

func ToLower added in v0.4.0

func ToLower(key string, expression any) bson.D

func ToLowerWithoutKey added in v0.9.0

func ToLowerWithoutKey(expression any) bson.D

func ToUpper added in v0.4.0

func ToUpper(key string, expression any) bson.D

func ToUpperWithoutKey added in v0.9.0

func ToUpperWithoutKey(expression any) bson.D

func Trunc added in v1.1.0

func Trunc(key string, numberExpression, placeExpression any) bson.D

func Week added in v0.4.0

func Week(key string, date time.Time) bson.D

func WeekWithTimezone added in v0.4.0

func WeekWithTimezone(key string, date time.Time, timezone string) bson.D

func WeekWithTimezoneWithoutKey added in v0.9.0

func WeekWithTimezoneWithoutKey(date time.Time, timezone string) bson.D

func WeekWithoutKey added in v0.9.0

func WeekWithoutKey(date time.Time) bson.D

func Year added in v0.4.0

func Year(key string, date time.Time) bson.D

func YearWithTimezone added in v0.4.0

func YearWithTimezone(key string, date time.Time, timezone string) bson.D

func YearWithTimezoneWithoutKey added in v0.9.0

func YearWithTimezoneWithoutKey(date time.Time, timezone string) bson.D

func YearWithoutKey added in v0.9.0

func YearWithoutKey(date time.Time) bson.D

Types

type BucketAutoOptions added in v1.0.0

type BucketAutoOptions struct {
	Output      any
	Granularity string
}

type BucketOptions added in v1.0.0

type BucketOptions struct {
	DefaultKey any
	Output     any
}

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

func NewBuilder added in v1.0.0

func NewBuilder() *Builder

func (*Builder) Abs added in v1.1.0

func (b *Builder) Abs(key string, expression any) *Builder

func (*Builder) AbsWithoutKey added in v1.1.0

func (b *Builder) AbsWithoutKey(expression any) *Builder

func (*Builder) Add

func (b *Builder) Add(key string, expressions ...any) *Builder

func (*Builder) AddWithoutKey added in v0.9.0

func (b *Builder) AddWithoutKey(expressions ...any) *Builder

func (*Builder) And

func (b *Builder) And(key string, expressions ...any) *Builder

func (*Builder) AndWithoutKey added in v0.9.0

func (b *Builder) AndWithoutKey(expressions ...any) *Builder

func (*Builder) ArrayElemAt

func (b *Builder) ArrayElemAt(key string, expression any, index int64) *Builder

func (*Builder) ArrayElemAtWithoutKey added in v0.9.0

func (b *Builder) ArrayElemAtWithoutKey(expression any, index int64) *Builder

func (*Builder) ArrayToObject

func (b *Builder) ArrayToObject(key string, expression any) *Builder

func (*Builder) ArrayToObjectWithoutKey added in v0.9.0

func (b *Builder) ArrayToObjectWithoutKey(expression any) *Builder

func (*Builder) Avg

func (b *Builder) Avg(key string, expression any) *Builder

func (*Builder) AvgWithoutKey added in v0.9.0

func (b *Builder) AvgWithoutKey(expression any) *Builder

func (*Builder) Build

func (b *Builder) Build() bson.D

func (*Builder) Ceil added in v1.1.0

func (b *Builder) Ceil(key string, expression any) *Builder

func (*Builder) CeilWithoutKey added in v1.1.0

func (b *Builder) CeilWithoutKey(expression any) *Builder

func (*Builder) Concat

func (b *Builder) Concat(key string, expressions ...any) *Builder

func (*Builder) ConcatArrays

func (b *Builder) ConcatArrays(key string, arrays ...any) *Builder

func (*Builder) ConcatArraysWithoutKey added in v0.9.0

func (b *Builder) ConcatArraysWithoutKey(arrays ...any) *Builder

func (*Builder) ConcatWithoutKey added in v0.9.0

func (b *Builder) ConcatWithoutKey(expressions ...any) *Builder

func (Builder) Cond

func (b Builder) Cond(key string, boolExpr, tureExpr, falseExpr any) *Builder

func (Builder) CondWithoutKey added in v0.9.0

func (b Builder) CondWithoutKey(boolExpr, tureExpr, falseExpr any) *Builder

func (*Builder) Contact

func (b *Builder) Contact(key string, expressions ...any) *Builder

func (*Builder) ContactWithoutKey added in v0.9.0

func (b *Builder) ContactWithoutKey(expressions ...any) *Builder

func (*Builder) DateToString

func (b *Builder) DateToString(key string, date any, opt *DateToStringOptions) *Builder

func (*Builder) DateToStringWithoutKey added in v0.9.0

func (b *Builder) DateToStringWithoutKey(date any, opt *DateToStringOptions) *Builder

func (*Builder) DayOfMonth

func (b *Builder) DayOfMonth(key string, date time.Time) *Builder

func (*Builder) DayOfMonthWithTimezone

func (b *Builder) DayOfMonthWithTimezone(key string, date time.Time, timezone string) *Builder

func (*Builder) DayOfMonthWithTimezoneWithoutKey added in v0.9.0

func (b *Builder) DayOfMonthWithTimezoneWithoutKey(date time.Time, timezone string) *Builder

func (*Builder) DayOfMonthWithoutKey added in v0.9.0

func (b *Builder) DayOfMonthWithoutKey(date time.Time) *Builder

func (*Builder) DayOfWeek

func (b *Builder) DayOfWeek(key string, date time.Time) *Builder

func (*Builder) DayOfWeekWithTimezone

func (b *Builder) DayOfWeekWithTimezone(key string, date time.Time, timezone string) *Builder

func (*Builder) DayOfWeekWithTimezoneWithoutKey added in v0.9.0

func (b *Builder) DayOfWeekWithTimezoneWithoutKey(date time.Time, timezone string) *Builder

func (*Builder) DayOfWeekWithoutKey added in v0.9.0

func (b *Builder) DayOfWeekWithoutKey(date time.Time) *Builder

func (*Builder) DayOfYear

func (b *Builder) DayOfYear(key string, date time.Time) *Builder

func (*Builder) DayOfYearWithTimezone

func (b *Builder) DayOfYearWithTimezone(key string, date time.Time, timezone string) *Builder

func (*Builder) DayOfYearWithTimezoneWithoutKey added in v0.9.0

func (b *Builder) DayOfYearWithTimezoneWithoutKey(date time.Time, timezone string) *Builder

func (*Builder) DayOfYearWithoutKey added in v0.9.0

func (b *Builder) DayOfYearWithoutKey(date time.Time) *Builder

func (*Builder) Divide

func (b *Builder) Divide(key string, expressions ...any) *Builder

func (*Builder) DivideWithoutKey added in v0.9.0

func (b *Builder) DivideWithoutKey(expressions ...any) *Builder

func (*Builder) Eq

func (b *Builder) Eq(key string, expressions ...any) *Builder

func (*Builder) EqWithoutKey added in v0.9.0

func (b *Builder) EqWithoutKey(expressions ...any) *Builder

func (*Builder) Exp added in v1.1.0

func (b *Builder) Exp(key string, exponent any) *Builder

func (*Builder) ExpWithoutKey added in v1.1.0

func (b *Builder) ExpWithoutKey(exponent any) *Builder

func (*Builder) Filter added in v0.2.0

func (b *Builder) Filter(key string, inputArray any, cond any, opt *FilterOptions) *Builder

func (*Builder) FilterWithoutKey added in v0.9.0

func (b *Builder) FilterWithoutKey(inputArray any, cond any, opt *FilterOptions) *Builder

func (*Builder) First

func (b *Builder) First(key string, expression any) *Builder

func (*Builder) FirstWithoutKey added in v0.9.0

func (b *Builder) FirstWithoutKey(expression any) *Builder

func (*Builder) Floor added in v1.1.0

func (b *Builder) Floor(key string, numberExpression any) *Builder

func (*Builder) FloorWithoutKey added in v1.1.0

func (b *Builder) FloorWithoutKey(numberExpression any) *Builder

func (*Builder) Gt

func (b *Builder) Gt(key string, expressions ...any) *Builder

func (*Builder) GtWithoutKey added in v0.9.0

func (b *Builder) GtWithoutKey(expressions ...any) *Builder

func (*Builder) Gte

func (b *Builder) Gte(key string, expressions ...any) *Builder

func (*Builder) GteWithoutKey added in v0.9.0

func (b *Builder) GteWithoutKey(expressions ...any) *Builder

func (Builder) IfNull

func (b Builder) IfNull(key string, expr, replacement any) *Builder

func (Builder) IfNullWithoutKey added in v0.9.0

func (b Builder) IfNullWithoutKey(expr, replacement any) *Builder

func (*Builder) KeyValue added in v1.0.0

func (b *Builder) KeyValue(key string, value any) *Builder

func (*Builder) Last

func (b *Builder) Last(key string, expression any) *Builder

func (*Builder) LastWithoutKey added in v0.9.0

func (b *Builder) LastWithoutKey(expression any) *Builder

func (*Builder) Ln added in v1.1.0

func (b *Builder) Ln(key string, numberExpression any) *Builder

func (*Builder) LnWithoutKey added in v1.1.0

func (b *Builder) LnWithoutKey(numberExpression any) *Builder

func (*Builder) Log added in v1.1.0

func (b *Builder) Log(key string, numberExpression, baseNumberExpression any) *Builder

func (*Builder) Log10 added in v1.1.0

func (b *Builder) Log10(key string, numberExpression any) *Builder

func (*Builder) Log10WithoutKey added in v1.1.0

func (b *Builder) Log10WithoutKey(numberExpression any) *Builder

func (*Builder) LogWithoutKey added in v1.1.0

func (b *Builder) LogWithoutKey(numberExpression, baseNumberExpression any) *Builder

func (*Builder) Lt

func (b *Builder) Lt(key string, expressions ...any) *Builder

func (*Builder) LtWithoutKey added in v0.9.0

func (b *Builder) LtWithoutKey(expressions ...any) *Builder

func (*Builder) Lte

func (b *Builder) Lte(key string, expressions ...any) *Builder

func (*Builder) LteWithoutKey added in v0.9.0

func (b *Builder) LteWithoutKey(expressions ...any) *Builder

func (*Builder) Map added in v0.2.0

func (b *Builder) Map(key string, inputArray any, as string, in any) *Builder

func (*Builder) MapWithoutKey added in v0.9.0

func (b *Builder) MapWithoutKey(inputArray any, as string, in any) *Builder

func (*Builder) Max

func (b *Builder) Max(key string, expression any) *Builder

func (*Builder) MaxWithoutKey added in v0.9.0

func (b *Builder) MaxWithoutKey(expression any) *Builder

func (*Builder) Min

func (b *Builder) Min(key string, expression any) *Builder

func (*Builder) MinWithoutKey added in v0.9.0

func (b *Builder) MinWithoutKey(expression any) *Builder

func (*Builder) Mod

func (b *Builder) Mod(key string, expressions ...any) *Builder

func (*Builder) ModWithoutKey added in v0.9.0

func (b *Builder) ModWithoutKey(expressions ...any) *Builder

func (*Builder) Month

func (b *Builder) Month(key string, date time.Time) *Builder

func (*Builder) MonthWithTimezone

func (b *Builder) MonthWithTimezone(key string, date time.Time, timezone string) *Builder

func (*Builder) MonthWithTimezoneWithoutKey added in v0.9.0

func (b *Builder) MonthWithTimezoneWithoutKey(date time.Time, timezone string) *Builder

func (*Builder) MonthWithoutKey added in v0.9.0

func (b *Builder) MonthWithoutKey(date time.Time) *Builder

func (*Builder) Multiply

func (b *Builder) Multiply(key string, expressions ...any) *Builder

func (*Builder) MultiplyWithoutKey added in v0.9.0

func (b *Builder) MultiplyWithoutKey(expressions ...any) *Builder

func (*Builder) Ne

func (b *Builder) Ne(key string, expressions ...any) *Builder

func (*Builder) NeWithoutKey added in v0.9.0

func (b *Builder) NeWithoutKey(expressions ...any) *Builder

func (*Builder) Not

func (b *Builder) Not(key string, expressions ...any) *Builder

func (*Builder) NotWithoutKey added in v0.9.0

func (b *Builder) NotWithoutKey(expressions ...any) *Builder

func (*Builder) Or

func (b *Builder) Or(key string, expressions ...any) *Builder

func (*Builder) OrWithoutKey added in v0.9.0

func (b *Builder) OrWithoutKey(expressions ...any) *Builder

func (*Builder) Pow added in v1.1.0

func (b *Builder) Pow(key string, numberExpression, exponentExpression any) *Builder

func (*Builder) PowWithoutKey added in v1.1.0

func (b *Builder) PowWithoutKey(numberExpression, exponentExpression any) *Builder

func (*Builder) Push

func (b *Builder) Push(key string, expression any) *Builder

func (*Builder) PushWithoutKey added in v0.9.0

func (b *Builder) PushWithoutKey(expression any) *Builder

func (*Builder) Round added in v1.1.0

func (b *Builder) Round(key string, numberExpression, placeExpression any) *Builder

func (*Builder) RoundWithoutKey added in v1.1.0

func (b *Builder) RoundWithoutKey(numberExpression, placeExpression any) *Builder

func (*Builder) Size

func (b *Builder) Size(key string, expression any) *Builder

func (*Builder) SizeWithoutKey added in v0.9.0

func (b *Builder) SizeWithoutKey(expression any) *Builder

func (*Builder) Slice

func (b *Builder) Slice(key string, array any, nElements int64) *Builder

func (*Builder) SliceWithPosition

func (b *Builder) SliceWithPosition(key string, array any, position, nElements int64) *Builder

func (*Builder) SliceWithPositionWithoutKey added in v0.9.0

func (b *Builder) SliceWithPositionWithoutKey(array any, position, nElements int64) *Builder

func (*Builder) SliceWithoutKey added in v0.9.0

func (b *Builder) SliceWithoutKey(array any, nElements int64) *Builder

func (*Builder) Sqrt added in v1.1.0

func (b *Builder) Sqrt(key string, numberExpression any) *Builder

func (*Builder) SqrtWithoutKey added in v1.1.0

func (b *Builder) SqrtWithoutKey(numberExpression any) *Builder

func (*Builder) SubstrBytes

func (b *Builder) SubstrBytes(key string, stringExpression string, byteIndex int64, byteCount int64) *Builder

func (*Builder) SubstrBytesWithoutKey added in v0.9.0

func (b *Builder) SubstrBytesWithoutKey(stringExpression string, byteIndex int64, byteCount int64) *Builder

func (*Builder) Subtract

func (b *Builder) Subtract(key string, expressions ...any) *Builder

func (*Builder) SubtractWithoutKey added in v0.9.0

func (b *Builder) SubtractWithoutKey(expressions ...any) *Builder

func (*Builder) Sum

func (b *Builder) Sum(key string, expression any) *Builder

func (*Builder) SumWithoutKey added in v0.9.0

func (b *Builder) SumWithoutKey(expression any) *Builder

func (Builder) Switch

func (b Builder) Switch(key string, cases []CaseThen, defaultCase any) *Builder

func (Builder) SwitchWithoutKey added in v0.9.0

func (b Builder) SwitchWithoutKey(cases []CaseThen, defaultCase any) *Builder

func (*Builder) ToLower

func (b *Builder) ToLower(key string, expression any) *Builder

func (*Builder) ToLowerWithoutKey added in v0.9.0

func (b *Builder) ToLowerWithoutKey(expression any) *Builder

func (*Builder) ToUpper

func (b *Builder) ToUpper(key string, expression any) *Builder

func (*Builder) ToUpperWithoutKey added in v0.9.0

func (b *Builder) ToUpperWithoutKey(expression any) *Builder

func (*Builder) Trunc added in v1.1.0

func (b *Builder) Trunc(key string, numberExpression, placeExpression any) *Builder

func (*Builder) TruncWithoutKey added in v1.1.0

func (b *Builder) TruncWithoutKey(numberExpression, placeExpression any) *Builder

func (*Builder) Week

func (b *Builder) Week(key string, date time.Time) *Builder

func (*Builder) WeekWithTimezone

func (b *Builder) WeekWithTimezone(key string, date time.Time, timezone string) *Builder

func (*Builder) WeekWithTimezoneWithoutKey added in v0.9.0

func (b *Builder) WeekWithTimezoneWithoutKey(date time.Time, timezone string) *Builder

func (*Builder) WeekWithoutKey added in v0.9.0

func (b *Builder) WeekWithoutKey(date time.Time) *Builder

func (*Builder) Year

func (b *Builder) Year(key string, date time.Time) *Builder

func (*Builder) YearWithTimezone

func (b *Builder) YearWithTimezone(key string, date time.Time, timezone string) *Builder

func (*Builder) YearWithTimezoneWithoutKey added in v0.9.0

func (b *Builder) YearWithTimezoneWithoutKey(date time.Time, timezone string) *Builder

func (*Builder) YearWithoutKey added in v0.9.0

func (b *Builder) YearWithoutKey(date time.Time) *Builder

type CaseThen added in v1.0.0

type CaseThen struct {
	Case any
	Then any
}

type DateToStringOptions added in v1.0.0

type DateToStringOptions struct {
	Format   string
	Timezone string
	OnNull   any
}

type FilterOptions added in v1.0.0

type FilterOptions struct {
	As    string
	Limit int64
}

type LookUpOptions added in v0.18.0

type LookUpOptions struct {
	LocalField   string
	ForeignField string
	Let          bson.D
	Pipeline     mongo.Pipeline
}

type StageBuilder

type StageBuilder struct {
	// contains filtered or unexported fields
}

func NewStageBuilder added in v1.0.1

func NewStageBuilder() *StageBuilder

func (*StageBuilder) AddFields

func (b *StageBuilder) AddFields(value any) *StageBuilder

func (*StageBuilder) Bucket

func (b *StageBuilder) Bucket(groupBy any, boundaries []any, opt *BucketOptions) *StageBuilder

func (*StageBuilder) BucketAuto

func (b *StageBuilder) BucketAuto(groupBy any, buckets int, opt *BucketAutoOptions) *StageBuilder

func (*StageBuilder) Build

func (b *StageBuilder) Build() mongo.Pipeline

func (*StageBuilder) Count

func (b *StageBuilder) Count(countName string) *StageBuilder

func (*StageBuilder) Facet

func (b *StageBuilder) Facet(value any) *StageBuilder

func (*StageBuilder) Group

func (b *StageBuilder) Group(id any, accumulators ...bson.E) *StageBuilder

func (*StageBuilder) Limit

func (b *StageBuilder) Limit(limit int64) *StageBuilder

func (*StageBuilder) Lookup added in v0.18.0

func (b *StageBuilder) Lookup(from, as string, opt *LookUpOptions) *StageBuilder

func (*StageBuilder) Match

func (b *StageBuilder) Match(expression any) *StageBuilder

func (*StageBuilder) Project

func (b *StageBuilder) Project(value any) *StageBuilder

func (*StageBuilder) ReplaceWith

func (b *StageBuilder) ReplaceWith(replacementDocument any) *StageBuilder

func (*StageBuilder) Set

func (b *StageBuilder) Set(value any) *StageBuilder

func (*StageBuilder) Skip

func (b *StageBuilder) Skip(skip int64) *StageBuilder

func (*StageBuilder) Sort

func (b *StageBuilder) Sort(value any) *StageBuilder

func (*StageBuilder) SortByCount

func (b *StageBuilder) SortByCount(expression any) *StageBuilder

func (*StageBuilder) Unwind

func (b *StageBuilder) Unwind(path string, opt *UnWindOptions) *StageBuilder

type UnWindOptions added in v1.0.0

type UnWindOptions struct {
	IncludeArrayIndex          string
	PreserveNullAndEmptyArrays bool
}

Jump to

Keyboard shortcuts

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