FIRSetOptions


@interface FIRSetOptions : NSObject

An options object that configures the behavior of setData() calls. By providing the FIRSetOptions objects returned by merge:, the setData() methods in FIRDocumentReference, FIRWriteBatch and FIRTransaction can be configured to perform granular merges instead of overwriting the target documents in their entirety.

  • Declaration

    Objective-C

    - (nonnull id)init;
  • Changes the behavior of setData() calls to only replace the values specified in its data argument. Fields with no corresponding values in the data passed to setData() will remain untouched.

    Declaration

    Swift

    class func merge() -> Self

    Objective-C

    + (nonnull instancetype)merge;

    Return Value

    The created FIRSetOptions object

  • Whether setData() should merge existing data instead of performing an overwrite.

    Declaration

    Swift

    var isMerge: Bool { get }

    Objective-C

    @property (readonly, getter=isMerge, nonatomic) BOOL merge;