FIRQueryDocumentSnapshot


@interface FIRQueryDocumentSnapshot : FIRDocumentSnapshot

A FIRQueryDocumentSnapshot contains data read from a document in your Firestore database as part of a query. The document is guaranteed to exist and its data can be extracted with the data property or by using subscript syntax to access a specific field.

A FIRQueryDocumentSnapshot offers the same API surface as a FIRDocumentSnapshot. As deleted documents are not returned from queries, its exists property will always be true and data: will never return nil.

  • Declaration

    Objective-C

    - (nonnull instancetype)init;
  • Retrieves all fields in the document as an NSDictionary.

    Server-provided timestamps that have not yet been set to their final value will be returned as NSNull. You can use dataWithOptions() to configure this behavior.

    Declaration

    Objective-C

    - (nonnull NSDictionary<NSString *, id> *)data;

    Return Value

    An NSDictionary containing all fields in the document.

  • Retrieves all fields in the document as a Dictionary.

    Declaration

    Objective-C

    - (nonnull NSDictionary<NSString *, id> *)dataWithServerTimestampBehavior:
        (FIRServerTimestampBehavior)serverTimestampBehavior;

    Parameters

    serverTimestampBehavior

    Configures how server timestamps that have not yet been set to their final value are returned from the snapshot.

    Return Value

    A Dictionary containing all fields in the document.