aggregation

package
v2.0.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

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

func Add

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

func AddWithoutKey

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

func And

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

func AndWithoutKey

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

func ArrayElemAt

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

func ArrayElemAtWithoutKey

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

func ArrayToObject

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

func ArrayToObjectWithoutKey

func ArrayToObjectWithoutKey(expression any) bson.D

func Avg

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

func AvgWithoutKey

func AvgWithoutKey(expression any) bson.D

func Ceil

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

func Concat

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

func ConcatArrays

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

func ConcatArraysWithoutKey

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

func ConcatWithoutKey

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

func Cond

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

func CondWithoutKey

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

func Contact

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

func ContactWithoutKey

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

func DateToString

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

func DateToStringWithoutKey

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

func DayOfMonth

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

func DayOfMonthWithTimezone

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

func DayOfMonthWithTimezoneWithoutKey

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

func DayOfMonthWithoutKey

func DayOfMonthWithoutKey(date time.Time) bson.D

func DayOfWeek

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

func DayOfWeekWithTimezone

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

func DayOfWeekWithTimezoneWithoutKey

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

func DayOfWeekWithoutKey

func DayOfWeekWithoutKey(date time.Time) bson.D

func DayOfYear

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

func DayOfYearWithTimezone

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

func DayOfYearWithTimezoneWithoutKey

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

func DayOfYearWithoutKey

func DayOfYearWithoutKey(date time.Time) bson.D

func Divide

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

func DivideWithoutKey

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

func Eq

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

func EqWithoutKey

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

func Exp

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

func Filter

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

func FilterWithoutKey

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

func First

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

func FirstWithoutKey

func FirstWithoutKey(expression any) bson.D

func Floor

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

func Gt

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

func GtWithoutKey

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

func Gte

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

func GteWithoutKey

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

func IfNull

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

func IfNullWithoutKey

func IfNullWithoutKey(expr, replacement any) bson.D

func Last

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

func LastWithoutKey

func LastWithoutKey(expression any) bson.D

func Ln

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

func Log

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

func Log10

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

func Lt

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

func LtWithoutKey

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

func Lte

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

func LteWithoutKey

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

func Map

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

func MapWithoutKey

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

func Max

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

func MaxWithoutKey

func MaxWithoutKey(expression any) bson.D

func Min

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

func MinWithoutKey

func MinWithoutKey(expression any) bson.D

func Mod

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

func ModWithoutKey

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

func Month

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

func MonthWithTimezone

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

func MonthWithTimezoneWithoutKey

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

func MonthWithoutKey

func MonthWithoutKey(date time.Time) bson.D

func Multiply

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

func MultiplyWithoutKey

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

func Ne

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

func NeWithoutKey

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

func Not

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

func NotWithoutKey

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

func Or

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

func OrWithoutKey

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

func Pow

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

func Push

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

func PushWithoutKey

func PushWithoutKey(expression any) bson.D

func Round

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

func Size

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

func SizeWithoutKey

func SizeWithoutKey(expression any) bson.D

func Slice

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

func SliceWithPosition

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

func SliceWithPositionWithoutKey

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

func SliceWithoutKey

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

func Sqrt

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

func SubstrBytes

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

func SubstrBytesWithoutKey

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

func Subtract

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

func SubtractWithoutKey

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

func Sum

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

func SumWithoutKey

func SumWithoutKey(expression any) bson.D

func Switch

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

func SwitchWithoutKey

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

func ToLower

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

func ToLowerWithoutKey

func ToLowerWithoutKey(expression any) bson.D

func ToUpper

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

func ToUpperWithoutKey

func ToUpperWithoutKey(expression any) bson.D

func Trunc

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

func Week

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

func WeekWithTimezone

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

func WeekWithTimezoneWithoutKey

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

func WeekWithoutKey

func WeekWithoutKey(date time.Time) bson.D

func Year

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

func YearWithTimezone

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

func YearWithTimezoneWithoutKey

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

func YearWithoutKey

func YearWithoutKey(date time.Time) bson.D

Types

type BucketAutoOptions

type BucketAutoOptions struct {
	Output      any
	Granularity string
}

type BucketOptions

type BucketOptions struct {
	DefaultKey any
	Output     any
}

type Builder

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

func NewBuilder

func NewBuilder() *Builder

func (*Builder) Abs

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

func (*Builder) AbsWithoutKey

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

func (*Builder) Add

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

func (*Builder) AddWithoutKey

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

func (*Builder) And

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

func (*Builder) AndWithoutKey

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

func (*Builder) ArrayElemAt

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

func (*Builder) ArrayElemAtWithoutKey

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

func (*Builder) ArrayToObject

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

func (*Builder) ArrayToObjectWithoutKey

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

func (*Builder) Avg

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

func (*Builder) AvgWithoutKey

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

func (*Builder) Build

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

func (*Builder) Ceil

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

func (*Builder) CeilWithoutKey

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

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

func (*Builder) ConcatWithoutKey

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

func (Builder) Cond

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

func (Builder) CondWithoutKey

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

func (*Builder) Contact

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

func (*Builder) ContactWithoutKey

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

func (*Builder) DateToString

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

func (*Builder) DateToStringWithoutKey

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

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

func (*Builder) DayOfMonthWithoutKey

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

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

func (*Builder) DayOfWeekWithoutKey

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

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

func (*Builder) DayOfYearWithoutKey

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

func (*Builder) Divide

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

func (*Builder) DivideWithoutKey

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

func (*Builder) Eq

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

func (*Builder) EqWithoutKey

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

func (*Builder) Exp

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

func (*Builder) ExpWithoutKey

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

func (*Builder) Filter

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

func (*Builder) FilterWithoutKey

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

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

func (*Builder) Floor

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

func (*Builder) FloorWithoutKey

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

func (*Builder) Gt

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

func (*Builder) GtWithoutKey

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

func (*Builder) Gte

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

func (*Builder) GteWithoutKey

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

func (Builder) IfNull

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

func (Builder) IfNullWithoutKey

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

func (*Builder) KeyValue

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

func (*Builder) Last

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

func (*Builder) LastWithoutKey

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

func (*Builder) Ln

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

func (*Builder) LnWithoutKey

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

func (*Builder) Log

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

func (*Builder) Log10

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

func (*Builder) Log10WithoutKey

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

func (*Builder) LogWithoutKey

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

func (*Builder) Lt

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

func (*Builder) LtWithoutKey

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

func (*Builder) Lte

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

func (*Builder) LteWithoutKey

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

func (*Builder) Map

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

func (*Builder) MapWithoutKey

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

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

func (*Builder) Min

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

func (*Builder) MinWithoutKey

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

func (*Builder) Mod

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

func (*Builder) ModWithoutKey

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

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

func (*Builder) MonthWithoutKey

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

func (*Builder) Multiply

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

func (*Builder) MultiplyWithoutKey

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

func (*Builder) Ne

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

func (*Builder) NeWithoutKey

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

func (*Builder) Not

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

func (*Builder) NotWithoutKey

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

func (*Builder) Or

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

func (*Builder) OrWithoutKey

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

func (*Builder) Pow

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

func (*Builder) PowWithoutKey

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

func (*Builder) Push

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

func (*Builder) PushWithoutKey

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

func (*Builder) Round

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

func (*Builder) RoundWithoutKey

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

func (*Builder) Size

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

func (*Builder) SizeWithoutKey

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

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

func (*Builder) SliceWithoutKey

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

func (*Builder) Sqrt

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

func (*Builder) SqrtWithoutKey

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

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

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

func (*Builder) Sum

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

func (*Builder) SumWithoutKey

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

func (Builder) Switch

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

func (Builder) SwitchWithoutKey

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

func (*Builder) ToLower

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

func (*Builder) ToLowerWithoutKey

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

func (*Builder) ToUpper

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

func (*Builder) ToUpperWithoutKey

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

func (*Builder) Trunc

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

func (*Builder) TruncWithoutKey

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

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

func (*Builder) WeekWithoutKey

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

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

func (*Builder) YearWithoutKey

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

type CaseThen

type CaseThen struct {
	Case any
	Then any
}

type DateToStringOptions

type DateToStringOptions struct {
	Format   string
	Timezone string
	OnNull   any
}

type FilterOptions

type FilterOptions struct {
	As    string
	Limit int64
}

type LookUpOptions

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

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

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

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