Stay organized with collections
Save and categorize content based on your preferences.
QuerySnapshot
classQuerySnapshot:NSObject,@uncheckedSendable
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.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-03-11 UTC."],[],[],null,["# FirebaseFirestore Framework Reference\n\nQuerySnapshot\n=============\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 `\n ` \n The query on which you called `getDocuments` or listened to in order to get this\n `QuerySnapshot`. \n\n #### Declaration\n\n Swift \n\n var query: FIRQuery { get }\n\n- `\n ``\n ``\n `\n\n ### [metadata](#/c:objc(cs)FIRQuerySnapshot(py)metadata)\n\n `\n ` \n Metadata about this snapshot, concerning its source and if it has local modifications. \n\n #### Declaration\n\n Swift \n\n var metadata: FIRSnapshotMetadata { get }\n\n- `\n ``\n ``\n `\n\n ### [isEmpty](#/c:objc(cs)FIRQuerySnapshot(py)empty)\n\n `\n ` \n Indicates whether this `QuerySnapshot` is empty (contains no documents). \n\n #### Declaration\n\n Swift \n\n var isEmpty: Bool { get }\n\n- `\n ``\n ``\n `\n\n ### [count](#/c:objc(cs)FIRQuerySnapshot(py)count)\n\n `\n ` \n The count of documents in this `QuerySnapshot`. \n\n #### Declaration\n\n Swift \n\n var count: Int { get }\n\n- `\n ``\n ``\n `\n\n ### [documents](#/c:objc(cs)FIRQuerySnapshot(py)documents)\n\n `\n ` \n An Array of the `DocumentSnapshots` that make up this document set. \n\n #### Declaration\n\n Swift \n\n var documents: [FIRQueryDocumentSnapshot] { get }\n\n- `\n ``\n ``\n `\n\n ### [documentChanges](#/c:objc(cs)FIRQuerySnapshot(py)documentChanges)\n\n `\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\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 `\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\n Swift \n\n func documentChanges(includeMetadataChanges: Bool) -\u003e [FIRDocumentChange]\n\n #### Parameters\n\n |--------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n | ` `*includeMetadataChanges*` ` | Whether metadata-only changes (i.e. only [DocumentSnapshot.metadata](../Classes/DocumentSnapshot.html#/c:objc(cs)FIRDocumentSnapshot(py)metadata) changed) should be included. |"]]