AggregationPipeline

public struct AggregationPipeline: ExpressibleByArrayLiteral, ValueConvertible

A Pipeline used for aggregation queries

  • The resulting Document that can be modified by the user.

    Declaration

    Swift

    public var pipelineDocument: Document = []
  • Allows embedding this pipeline inside another Document

    Declaration

    Swift

    public func makePrimitive() -> BSON.Primitive
  • You can easily and naturally create an aggregate by providing a variadic list of stages.

    Declaration

    Swift

    public init(arrayLiteral elements: Stage...)
  • You can easily and naturally create an aggregate by providing an array of stages.

    Declaration

    Swift

    public init(arrayLiteral elements: [Stage])
  • Appends a stage to this pipeline

    Declaration

    Swift

    public mutating func append(_ stage: Stage)
  • Creates an empty pipeline

    Declaration

    Swift

    public init()
  • Create a pipeline from a Document

    Declaration

    Swift

    public init(_ document: Document)
  • A Pipeline stage. Pipelines pass their data of the collection through every stage. The last stage defines the output.

    The input are all Documents in the collection.

    The input of stage 2 is the output of stage 3 and so on..

    See more

    Declaration

    Swift

    public struct Stage: ValueConvertible