# Packages
Package aggregations provides aggregation pipelines.
# Functions
AddFieldsIterator returns an iterator that adds a new field to the underlying iterator.
AssertType asserts value's type, returning protocol error for unexpected types.
CheckClientMetadata checks if the message does not contain client metadata after it was received already.
CountIterator returns an iterator that returns a single document containing the number of input documents (as int32) in the specified field: {field: count}.
FilterDistinctValues returns distinct values from the given slice of documents with the given key.
FilterDocument returns true if given document satisfies given filter expression.
FilterIterator returns an iterator that filters out documents that don't match the filter.
GetCountParams returns the parameters for the count command.
GetDeleteParams returns parameters for delete operation.
GetDistinctParams returns `distinct` command parameters.
GetExplainParams returns the parameters for the explain command.
GetFindAndModifyParams returns `findAndModifyParams` command parameters.
GetFindParams returns `find` command parameters.
GetInsertParams returns the parameters for an insert command.
GetLimitParam returns limit value from provided query document.
GetLimitStageParam returns $limit stage argument from the provided value.
GetOptionalNullParam returns doc's value for key, default value for missing parameter or null, or protocol error for other invalid type.
GetOptionalParam returns doc's value for key, default value for missing parameter, or protocol error for invalid type.
GetRequiredParam returns doc's value for key or protocol error for missing key or invalid type.
GetSkipStageParam returns $skip stage argument from the provided value.
GetSortType determines SortType from input sort value.
GetUpdateParams returns parameters for update command.
HasQueryOperator recursively checks if filter document contains any operator prefixed with $.
HasSupportedUpdateModifiers checks that update document contains supported update operators.
Ignored logs a message if doc has any of the given fields.
IsMaster is a common implementation of the isMaster command used by deprecated OP_QUERY message.
IsMasterDocuments returns isMaster's Documents field (identical for both OP_MSG and OP_QUERY).
LimitDocuments returns a subslice of given documents according to the given limit value.
LimitIterator returns an iterator that limits a number of documents returned by the underlying iterator.
ProjectDocument applies projection to the copy of the document.
ProjectionIterator returns an iterator that projects documents returned by the underlying iterator.
SkipDocuments returns a subslice of given documents according to the given skip value.
SkipIterator returns an iterator that skips a number of documents returned by the underlying iterator.
SortArray sorts the values of given array.
SortDocuments sorts given documents in place according to the given sorting conditions.
SortIterator returns an iterator of sorted documents.
Unimplemented returns handlererrors.ErrNotImplemented if doc has any of the given fields.
UnimplementedNonDefault returns handlererrors.ErrNotImplemented if doc has given field, and isDefault, called with the actual value, returns false.
UpdateDocument updates the given document with a series of update operators.
ValidateProjection check projection document.
ValidateSortDocument validates sort documents, and return proper error if it's invalid.
ValidateUpdateOperators validates update statement.
# Constants
MaxWireVersion is the maximal supported wire protocol version.
needed for some apps and drivers.
# Structs
CountParams represents parameters for the count command.
Delete represents single delete operation parameters.
DeleteParams represents parameters for the delete command.
DistinctParams contains `distinct` command parameters supported by at least one handler.
ExplainParams represents the parameters for the explain command.
FindAndModifyParams represent parameters for the findAndModify command.
FindParams represents parameters for the find command.
InsertParams represents the parameters for an insert command.
Update represents a single update operation parameters.
UpdateParams represents parameters for the update command.