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, or findOneAndDelete command on a RLMMongoCollection

    Declaration

    Swift

    public convenience init(_ projection: Document?,
                            _ sort: Document?,
                            _ upsert: Bool=false,
                            _ shouldReturnNewDocument: Bool=false)

    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)