FindOneAndReplaceOptions
public struct FindOneAndReplaceOptions : FindAndModifyOptionsConvertible
Options to use when executing a findOneAndReplace
command on a MongoCollection
.
-
If
true
, allows the write to opt-out of document level validation.Declaration
Swift
public let bypassDocumentValidation: Bool?
-
Specifies a collation to use.
Declaration
Swift
public let collation: Document?
-
The maximum amount of time to allow the query to run.
Declaration
Swift
public let maxTimeMS: Int64?
-
Limits the fields to return for the matching document.
Declaration
Swift
public let projection: Document?
-
When
ReturnDocument.After
, returns the replaced or inserted document rather than the original.Declaration
Swift
public let returnDocument: ReturnDocument?
-
Determines which document the operation modifies if the query selects multiple documents.
Declaration
Swift
public let sort: Document?
-
When
true
, creates a new document if no document matches the query.Declaration
Swift
public let upsert: Bool?
-
An optional
WriteConcern
to use for the command.Declaration
Swift
public let writeConcern: WriteConcern?
-
init(bypassDocumentValidation:collation:maxTimeMS:projection:returnDocument:sort:upsert:writeConcern:)
Convenience initializer allowing any/all parameters to be omitted/optional
Declaration
Swift
public init(bypassDocumentValidation: Bool? = nil, collation: Document? = nil, maxTimeMS: Int64? = nil, projection: Document? = nil, returnDocument: ReturnDocument? = nil, sort: Document? = nil, upsert: Bool? = nil, writeConcern: WriteConcern? = nil)