AggregateOptions

public struct AggregateOptions : Codable

Options to use when executing an aggregate command on a MongoCollection.

  • Enables writing to temporary files. When set to true, aggregation stages can write data to the _tmp subdirectory in the dbPath directory.

    Declaration

    Swift

    public var allowDiskUse: Bool?
  • The number of Documents to return per batch.

    Declaration

    Swift

    public var batchSize: Int32?
  • If true, allows the write to opt-out of document level validation. This only applies when the $out stage is specified.

    Declaration

    Swift

    public var bypassDocumentValidation: Bool?
  • Specifies a collation.

    Declaration

    Swift

    public var collation: Document?
  • The maximum amount of time to allow the query to run.

    Declaration

    Swift

    public var maxTimeMS: Int64?
  • Enables users to specify an arbitrary string to help trace the operation through the database profiler, currentOp and logs. The default is to not send a value.

    Declaration

    Swift

    public var comment: String?
  • The index hint to use for the aggregation. The hint does not apply to $lookup and $graphLookup stages.

    Declaration

    Swift

    public var hint: Hint?
  • A ReadConcern to use in read stages of this operation.

    Declaration

    Swift

    public var readConcern: ReadConcern?
  • A ReadPreference to use for this operation.

    Declaration

    Swift

    public var readPreference: ReadPreference?
  • A WriteConcern to use in $out stages of this operation.

    Declaration

    Swift

    public var writeConcern: WriteConcern?
  • Convenience initializer allowing any/all parameters to be omitted or optional.

    Declaration

    Swift

    public init(allowDiskUse: Bool? = nil,
                batchSize: Int32? = nil,
                bypassDocumentValidation: Bool? = nil,
                collation: Document? = nil,
                comment: String? = nil,
                hint: Hint? = nil,
                maxTimeMS: Int64? = nil,
                readConcern: ReadConcern? = nil,
                readPreference: ReadPreference? = nil,
                writeConcern: WriteConcern? = nil)