Documentation ¶
Overview ¶
Package projection provides projection for aggregations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProjectDocument ¶
ProjectDocument applies projection to the copy of the document.
func ProjectionIterator ¶
func ProjectionIterator(iter types.DocumentsIterator, closer *iterator.MultiCloser, projection *types.Document) (types.DocumentsIterator, error)
ProjectionIterator returns an iterator that projects documents returned by the underlying iterator. It will be added to the given closer.
Next method returns the next projected document.
Close method closes the underlying iterator.
func ValidateProjection ¶
ValidateProjection check projection document. Document fields could be either included or excluded but not both. Exception is for the _id field that could be included or excluded.
Command error codes:
- `ErrEmptyProject` when projection document is empty;
- `ErrProjectionExIn` when there is exclusion in inclusion projection;
- `ErrProjectionInEx` when there is inclusion in exclusion projection;
- `ErrEmptyFieldPath` when projection path is empty;
- `ErrPathContainsEmptyElement` when projection path contains empty key;
- `ErrFieldPathInvalidName` when `$` is at the prefix of a key in the path;
- `ErrWrongPositionalOperatorLocation` when there are multiple `$`;
- `ErrAggregatePositionalProject` when `$` is used in the suffix key;
- `ErrAggregatePositionalProject` when positional projection contains empty path;
- `ErrNotImplemented` when there is unimplemented projection operators and expressions.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.