FirebaseFirestore Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
QuerySnapshot
class QuerySnapshot : NSObject, @unchecked Sendable
A QuerySnapshot
contains zero or more DocumentSnapshot
objects. It can be enumerated
using the documents
property and its size can be inspected with isEmpty
and
count
.
-
The query on which you called getDocuments
or listened to in order to get this
QuerySnapshot
.
Declaration
Swift
var query: FIRQuery { get }
-
Metadata about this snapshot, concerning its source and if it has local modifications.
Declaration
Swift
var metadata: FIRSnapshotMetadata { get }
-
Indicates whether this QuerySnapshot
is empty (contains no documents).
Declaration
Swift
var isEmpty: Bool { get }
-
The count of documents in this QuerySnapshot
.
Declaration
Swift
var count: Int { get }
-
An Array of the DocumentSnapshots
that make up this document set.
Declaration
Swift
var documents: [FIRQueryDocumentSnapshot] { get }
-
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 }
-
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
Swift
func documentChanges(includeMetadataChanges: Bool) -> [FIRDocumentChange]
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-03-11 UTC.
[null,null,["Last updated 2025-03-11 UTC."],[],[],null,["QuerySnapshot \n\n class QuerySnapshot : NSObject, @unchecked Sendable\n\nA `QuerySnapshot` contains zero or more [DocumentSnapshot](../Classes/DocumentSnapshot.html) objects. It can be enumerated\nusing the `documents` property and its size can be inspected with `isEmpty` and\n`count`.\n- `\n ``\n ``\n `\n\n [query](#/c:objc(cs)FIRQuerySnapshot(py)query)`\n ` \n The query on which you called `getDocuments` or listened to in order to get this\n `QuerySnapshot`. \n\n Declaration \n Swift \n\n var query: FIRQuery { get }\n\n- `\n ``\n ``\n `\n\n [metadata](#/c:objc(cs)FIRQuerySnapshot(py)metadata)`\n ` \n Metadata about this snapshot, concerning its source and if it has local modifications. \n\n Declaration \n Swift \n\n var metadata: FIRSnapshotMetadata { get }\n\n- `\n ``\n ``\n `\n\n [isEmpty](#/c:objc(cs)FIRQuerySnapshot(py)empty)`\n ` \n Indicates whether this `QuerySnapshot` is empty (contains no documents). \n\n Declaration \n Swift \n\n var isEmpty: Bool { get }\n\n- `\n ``\n ``\n `\n\n [count](#/c:objc(cs)FIRQuerySnapshot(py)count)`\n ` \n The count of documents in this `QuerySnapshot`. \n\n Declaration \n Swift \n\n var count: Int { get }\n\n- `\n ``\n ``\n `\n\n [documents](#/c:objc(cs)FIRQuerySnapshot(py)documents)`\n ` \n An Array of the `DocumentSnapshots` that make up this document set. \n\n Declaration \n Swift \n\n var documents: [FIRQueryDocumentSnapshot] { get }\n\n- `\n ``\n ``\n `\n\n [documentChanges](#/c:objc(cs)FIRQuerySnapshot(py)documentChanges)`\n ` \n An array of the documents that changed since the last snapshot. If this is the first snapshot,\n all documents will be in the list as Added changes. \n\n Declaration \n Swift \n\n var documentChanges: [FIRDocumentChange] { get }\n\n- `\n ``\n ``\n `\n\n [documentChanges(includeMetadataChanges:)](#/c:objc(cs)FIRQuerySnapshot(im)documentChangesWithIncludeMetadataChanges:)`\n ` \n Returns an array of the documents that changed since the last snapshot. If this is the first\n snapshot, all documents will be in the list as Added changes. \n\n Declaration \n Swift \n\n func documentChanges(includeMetadataChanges: Bool) -\u003e [FIRDocumentChange]\n\n Parameters"]]