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

    Swift

    var query: FIRQuery { get }

    Objective-C

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

    Declaration

    Swift

    var metadata: FIRSnapshotMetadata { get }

    Objective-C

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

    Declaration

    Swift

    var isEmpty: Bool { get }

    Objective-C

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

    Declaration

    Swift

    var count: Int { get }

    Objective-C

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

    Declaration

    Swift

    var documents: [FIRDocumentSnapshot] { get }

    Objective-C

    @property (readonly, strong, nonatomic)
        NSArray<FIRDocumentSnapshot *> *_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

    Swift

    var documentChanges: [FIRDocumentChange] { get }

    Objective-C

    @property (readonly, strong, nonatomic)
        NSArray<FIRDocumentChange *> *_Nonnull documentChanges;