FindOneAndModifyOptions
extension FindOneAndModifyOptions
-
Limits the fields to return for all matching documents.
Declaration
Swift
public var projection: Document? { get set }
-
The order in which to return matching documents.
Declaration
Swift
public var sort: Document? { get set }
-
Options to use when executing a
findOneAndUpdate
,findOneAndReplace
, orfindOneAndDelete
command on aMongoCollection
Declaration
Parameters
projection
Limits the fields to return for all matching documents.
sort
The order in which to return matching documents.
upsert
Whether or not to perform an upsert, default is false (only available for findOneAndReplace and findOneAndUpdate)
shouldReturnNewDocument
When true then the new document is returned, Otherwise the old document is returned (default) (only available for findOneAndReplace and findOneAndUpdate)
-
Options to use when executing a
findOneAndUpdate
,findOneAndReplace
, orfindOneAndDelete
command on aMongoCollection
Declaration
Parameters
projection
Limits the fields to return for all matching documents.
sort
The order in which to return matching documents.
upsert
Whether or not to perform an upsert, default is false (only available for findOneAndReplace and findOneAndUpdate)
shouldReturnNewDocument
When true then the new document is returned, Otherwise the old document is returned (default) (only available for findOneAndReplace and findOneAndUpdate)