Documentation ¶
Overview ¶
Package expr encapsulates operations of aggregation framework.
Index ¶
- func Add(a interface{}, b interface{}) bson.M
- func And(items ...interface{}) bson.M
- func Ceil(input interface{}) bson.M
- func CeilDateSeconds(step interface{}) bson.M
- func CeilIn24System(input interface{}) bson.M
- func CeilIn60System(input interface{}) bson.M
- func CeilWithStep(input interface{}, step interface{}) bson.M
- func Concat(parts ...interface{}) bson.M
- func ConcatArrays(arrays ...interface{}) bson.M
- func Cond(cond interface{}, t interface{}, f interface{}) bson.M
- func DateInTimezone(date interface{}, timezone *helpers.Timezone) interface{}
- func DateToTimestamp(date interface{}) bson.M
- func DayOfMonth(el interface{}) bson.M
- func DayOfWeek(el interface{}) bson.M
- func DayOfYear(el interface{}) bson.M
- func Divide(a interface{}, b interface{}) bson.M
- func Eq(a interface{}, b interface{}) bson.M
- func Facet() *facet
- func Field(name ...string) string
- func FirstDayOfMonth(yearDate interface{}, month int) interface{}
- func Floor(input interface{}) bson.M
- func FloorWithStep(input interface{}, step interface{}) bson.M
- func Gt(a interface{}, b interface{}) bson.M
- func Gte(a interface{}, b interface{}) bson.M
- func Hour(el interface{}) bson.M
- func In(el interface{}, array interface{}) bson.M
- func Let(vars bson.M, in interface{}) bson.M
- func Log10(a interface{}) bson.M
- func Lt(a interface{}, b interface{}) bson.M
- func Lte(a interface{}, b interface{}) bson.M
- func Map(input interface{}, as interface{}, in interface{}) bson.M
- func MergeObjects(objects interface{}) bson.M
- func Mod(a interface{}, b interface{}) bson.M
- func Month(el interface{}) bson.M
- func Multiply(a interface{}, b interface{}) bson.M
- func Ne(a interface{}, b interface{}) bson.M
- func NthSundayOfMonth(date interface{}, n int, numberOfDays int) bson.M
- func ObjectToArray(obj interface{}) bson.M
- func Or(items ...interface{}) bson.M
- func Pow(a interface{}, e interface{}) bson.M
- func Pow10(e interface{}) bson.M
- func ResetMonthDay(date interface{}) bson.M
- func Size(array interface{}) bson.M
- func Slice(array interface{}, length interface{}) bson.M
- func Subtract(a interface{}, b interface{}) bson.M
- func Switch() *sw
- func TimestampToDate(timestamp interface{}) bson.M
- func Type(el interface{}) bson.M
- func Var(name ...string) string
- func Year(el interface{}) bson.M
- type Pipeline
- func (p *Pipeline) AddStage(op string, spec interface{})
- func (p *Pipeline) AddStages(stages ...bson.M)
- func (p *Pipeline) GetPipe(c *mgo.Collection) *mgo.Pipe
- func (p *Pipeline) GetStages() []bson.M
- func (p *Pipeline) Iter(c *mgo.Collection, batchSize int) *mgo.Iter
- func (p *Pipeline) ToBsonChannel(c *mgo.Collection, outCh chan<- bson.M, concurrency int, bufferSize int, ...)
- func (p *Pipeline) ToRawChannel(c *mgo.Collection, outCh chan<- []byte, concurrency int, bufferSize int, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CeilDateSeconds ¶
CeilDateSeconds rounds up seconds to whole seconds, minutes, hours, days.
func CeilIn24System ¶
CeilIn24System - 1, 2, 3, 6, 12, 24
func CeilIn60System ¶
CeilIn60System - 1, 2, 5, 10, 15, 30, 60
func CeilWithStep ¶
CeilWithStep - ceil value with given step.
func ConcatArrays ¶
ConcatArrays encapsulates MongoDB operation $concatArrays.
func DateInTimezone ¶
DateInTimezone converts date in UTC timezone to desired timezone
func DateToTimestamp ¶
DateToTimestamp converts date to timestamp in DB.
func DayOfMonth ¶
DayOfMonth encapsulates MongoDB operation $dayOfMonth.
func FirstDayOfMonth ¶
func FirstDayOfMonth(yearDate interface{}, month int) interface{}
FirstDayOfMonth converts date to first day of given month. The year remains unchanged.
func FloorWithStep ¶
FloorWithStep - floor value with given step.
func MergeObjects ¶
MergeObjects encapsulates MongoDB operation $mergeObjects.
func NthSundayOfMonth ¶
NthSundayOfMonth get date of N-th sunday of month
func ObjectToArray ¶
ObjectToArray encapsulates MongoDB operation $objectToArray.
func ResetMonthDay ¶
ResetMonthDay converts date to date of the fist day of month
func TimestampToDate ¶
TimestampToDate converts timestamp to date in DB.
Types ¶
type Pipeline ¶
type Pipeline struct {
// contains filtered or unexported fields
}
Pipeline represents stages of aggregation pipeline in MongoDB.
func (*Pipeline) GetPipe ¶
func (p *Pipeline) GetPipe(c *mgo.Collection) *mgo.Pipe
GetPipe gets MongoDB aggregation pipe.