AggregateOptions
public struct AggregateOptions : Codable
Options to use when executing an aggregate
command on a MongoCollection
.
-
Enables the server to write to temporary files. When set to true, the aggregate operation can write data to the _tmp subdirectory in the dbPath directory.
Declaration
Swift
public var allowDiskUse: Bool?
-
The number of
BSONDocument
s to return per batch.Declaration
Swift
public var batchSize: Int?
-
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: BSONDocument?
-
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: IndexHint?
-
The variables to use for the aggregation. Variables can be accessed in the aggregation command using the double dollar sign prefix in the form
$$<variable_name>
. This option is only available on MongoDB 5.0+.Declaration
Swift
public var `let`: BSONDocument?
-
The maximum amount of time to allow the query to run.
Declaration
Swift
public var maxTimeMS: Int?
-
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?
-
init(allowDiskUse:
batchSize: bypassDocumentValidation: collation: comment: hint: let: maxTimeMS: readConcern: readPreference: writeConcern: ) Convenience initializer allowing any/all parameters to be omitted or optional.
Declaration
Swift
public init( allowDiskUse: Bool? = nil, batchSize: Int? = nil, bypassDocumentValidation: Bool? = nil, collation: BSONDocument? = nil, comment: String? = nil, hint: IndexHint? = nil, `let`: BSONDocument? = nil, maxTimeMS: Int? = nil, readConcern: ReadConcern? = nil, readPreference: ReadPreference? = nil, writeConcern: WriteConcern? = nil )