FIRQuerySnapshot


@interface FIRQuerySnapshot : NSObject

A FIRQuerySnapshot contains zero or more FIRDocumentSnapshot objects. It can be enumerated using for … in documentSet.documents and its size can be inspected with isEmpty and count.

  • Declaration

    Objective-C

    - (nonnull id)init;
  • The query on which you called getDocuments or listened to in order to get this FIRQuerySnapshot.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic) FIRQuery *_Nonnull query;
  • Metadata about this snapshot, concerning its source and if it has local modifications.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic) FIRSnapshotMetadata *_Nonnull metadata;
  • Indicates whether this FIRQuerySnapshot is empty (contains no documents).

    Declaration

    Objective-C

    @property (readonly, getter=isEmpty, nonatomic) BOOL empty;
  • The count of documents in this FIRQuerySnapshot.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSInteger count;
  • An Array of the FIRDocumentSnapshots that make up this document set.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic)
        NSArray<FIRQueryDocumentSnapshot *> *_Nonnull documents;
  • An array of the documents that changed since the last snapshot. If this is the first snapshot, all documents will be in the list as Added changes.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic)
        NSArray<FIRDocumentChange *> *_Nonnull documentChanges;
  • Returns an array of the documents that changed since the last snapshot. If this is the first snapshot, all documents will be in the list as Added changes.

    Declaration

    Objective-C

    - (nonnull NSArray<FIRDocumentChange *> *)
    documentChangesWithIncludeMetadataChanges:(BOOL)includeMetadataChanges;

    Parameters

    includeMetadataChanges

    Whether metadata-only changes (i.e. only FIRDocumentSnapshot.metadata changed) should be included.