FIRFieldValue


@interface FIRFieldValue : NSObject

Sentinel values that can be used when writing document fields with setData() or updateData().

  • Declaration

    Objective-C

    - (nonnull instancetype)init;
  • Used with updateData() to mark a field for deletion.

    Declaration

    Objective-C

    + (nonnull instancetype)fieldValueForDelete;
  • Used with setData() or updateData() to include a server-generated timestamp in the written data.

    Declaration

    Objective-C

    + (nonnull instancetype)fieldValueForServerTimestamp;
  • Returns a special value that can be used with setData() or updateData() that tells the server to union the given elements with any array value that already exists on the server. Each specified element that doesn’t already exist in the array will be added to the end. If the field being modified is not already an array it will be overwritten with an array containing exactly the specified elements.

    Declaration

    Objective-C

    + (nonnull instancetype)fieldValueForArrayUnion:(nonnull NSArray<id> *)elements;

    Parameters

    elements

    The elements to union into the array.

    Return Value

    The FieldValue sentinel for use in a call to setData() or updateData().

  • Returns a special value that can be used with setData() or updateData() that tells the server to remove the given elements from any array value that already exists on the server. All instances of each element specified will be removed from the array. If the field being modified is not already an array it will be overwritten with an empty array.

    Declaration

    Objective-C

    + (nonnull instancetype)fieldValueForArrayRemove:
        (nonnull NSArray<id> *)elements;

    Parameters

    elements

    The elements to remove from the array.

    Return Value

    The FieldValue sentinel for use in a call to setData() or updateData().