stages

package
v1.21.0 Latest Latest
Warning

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

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

Documentation

Overview

Package stages provides aggregation stages.

Index

Constants

This section is empty.

Variables

View Source
var Stages = map[string]newStageFunc{

	"$addFields": newAddFields,
	"$collStats": newCollStats,
	"$count":     newCount,
	"$group":     newGroup,
	"$limit":     newLimit,
	"$match":     newMatch,
	"$project":   newProject,
	"$set":       newSet,
	"$skip":      newSkip,
	"$sort":      newSort,
	"$unset":     newUnset,
	"$unwind":    newUnwind,
}

Stages maps all supported aggregation Stages.

Functions

func GetStatistics

func GetStatistics(stages []aggregations.Stage) map[Statistic]struct{}

GetStatistics has the same idea as GetPushdownQuery: it returns a list of statistics that need to be fetched from the DB, because they are needed for one or more stages.

func NewStage

func NewStage(stage *types.Document) (aggregations.Stage, error)

NewStage creates a new aggregation stage.

Types

type Statistic

type Statistic int32

Statistic represents a statistic that can be fetched from the DB.

const (
	StatisticCount Statistic
	StatisticLatency
	StatisticQueryExec
	StatisticStorage
)

List of statistics that can be fetched from the DB.

Directories

Path Synopsis
Package projection provides projection for aggregations.
Package projection provides projection for aggregations.

Jump to

Keyboard shortcuts

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