Documentation ¶
Overview ¶
Package builder help us to write aggregates, filters, update maps simpler.
Index ¶
- func S(operators ...Operator) bson.M
- type BaseOperator
- type Operator
- func Bucket(groupBy, boundaries, def, output interface{}) Operator
- func BucketAuto(groupBy, buckets, output, granularity interface{}) Operator
- func CollStats(latencyStats, storageStats, count interface{}) Operator
- func CurrentOp(allUsers, idleConnections, idleCursors, idleSessions, localOps interface{}) Operator
- func Group(ID interface{}, params bson.M) Operator
- func Lookup(from, localField, foreignField, as interface{}) Operator
- func Merge(into, on, let, whenMatched, whenNotMatched interface{}) Operator
- func New(key string, val interface{}) Operator
- func ReplaceRoot(newRoot interface{}) Operator
- func Sample(size interface{}) Operator
- func UncorrelatedLookup(from, let, pipeline, as interface{}) Operator
- func Unwind(path, includeArrayIndex, preserveNullAndEmptyArrays interface{}) Operator
- type SMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BaseOperator ¶
type BaseOperator struct {
// contains filtered or unexported fields
}
BaseOperator is a simple operator struct that implementes the Operator interface.
func (*BaseOperator) GetKey ¶
func (operator *BaseOperator) GetKey() string
GetKey function returns the operator's key.
func (*BaseOperator) GetVal ¶
func (operator *BaseOperator) GetVal() interface{}
GetVal function returns the operator's value.
type Operator ¶
type Operator interface { GetKey() string GetVal() interface{} }
Operator is an interface that should be implemented by structs used as operators.
func Bucket ¶
func Bucket(groupBy, boundaries, def, output interface{}) Operator
Bucket function returns a mongo $bucket operator used in aggregations.
func BucketAuto ¶
func BucketAuto(groupBy, buckets, output, granularity interface{}) Operator
BucketAuto function returns a mongo $bucketAuto operator used in aggregations.
func CollStats ¶
func CollStats(latencyStats, storageStats, count interface{}) Operator
CollStats function returns a mongo $collStats operator used in aggregations.
func CurrentOp ¶
func CurrentOp(allUsers, idleConnections, idleCursors, idleSessions, localOps interface{}) Operator
CurrentOp function returns a mongo $currentOp operator used in aggregations.
func Lookup ¶
func Lookup(from, localField, foreignField, as interface{}) Operator
Lookup function returns a mongo $lookup operator used in aggregations.
func Merge ¶
func Merge(into, on, let, whenMatched, whenNotMatched interface{}) Operator
Merge function returns a mongo $merge operator used in aggregations.
func ReplaceRoot ¶
func ReplaceRoot(newRoot interface{}) Operator
ReplaceRoot function returns a mongo $replaceRoot operator used in aggregations.
func Sample ¶
func Sample(size interface{}) Operator
Sample function returns a mongo sample operator used in aggregations.
func UncorrelatedLookup ¶
func UncorrelatedLookup(from, let, pipeline, as interface{}) Operator
UncorrelatedLookup function returns a mongo $lookup operator used in aggregations.