RLMFindOneAndModifyOptions

Objective-C

@interface RLMFindOneAndModifyOptions : NSObject

Swift

@_nonSendable(_assumed) class RLMFindOneAndModifyOptions : NSObject

Options to use when executing a findOneAndUpdate, findOneAndReplace, or findOneAndDelete command on a RLMMongoCollection.

  • Limits the fields to return for all matching documents.

    Declaration

    Objective-C

    @property (nonatomic, nullable) id<RLMBSON> projection;
  • Deprecated

    Use sorting instead, which correctly sort more than one sort attribute

    The order in which to return matching documents.

    Declaration

    Objective-C

    @property (nonatomic, nullable) id<RLMBSON> sort;
  • The order in which to return matching documents.

    Declaration

    Objective-C

    @property (nonatomic) NS_REFINED_FOR_SWIFT NSArray<id<RLMBSON>> *sorting;
  • Whether or not to perform an upsert, default is false (only available for find_one_and_replace and find_one_and_update)

    Declaration

    Objective-C

    @property (nonatomic) BOOL upsert;

    Swift

    var upsert: Bool { get set }
  • When true then the new document is returned, Otherwise the old document is returned (default) (only available for findOneAndReplace and findOneAndUpdate)

    Declaration

    Objective-C

    @property (nonatomic) BOOL shouldReturnNewDocument;

    Swift

    var shouldReturnNewDocument: Bool { get set }
  • Deprecated

    Please use initWithProjection:sorting:upsert:shouldReturnNewDocument:

    Options to use when executing a findOneAndUpdate, findOneAndReplace, or findOneAndDelete command on a RLMMongoCollection.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithProjection:(id<RLMBSON> _Nullable)projection
                                          sort:(id<RLMBSON> _Nullable)sort
                                        upsert:(BOOL)upsert
                       shouldReturnNewDocument:(BOOL)shouldReturnNewDocument;

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

    Declaration

    Objective-C

    - (nonnull instancetype)initWithProjection:(id<RLMBSON> _Nullable)projection
                                       sorting:
                                           (nonnull NSArray<id<RLMBSON>> *)sorting
                                        upsert:(BOOL)upsert
                       shouldReturnNewDocument:(BOOL)shouldReturnNewDocument;

    Swift

    init(projection: (any RLMBSON)?, sorting: [any RLMBSON], upsert: Bool, shouldReturnNewDocument: Bool)

    Parameters

    projection

    Limits the fields to return for all matching documents.

    sorting

    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)