Home > @firebase/firestore > lite > QuerySnapshot
QuerySnapshot class
A QuerySnapshot
contains zero or more DocumentSnapshot
objects representing the results of a query. The documents can be accessed as an array via the docs
property or enumerated using the forEach
method. The number of documents can be determined via the empty
and size
properties.
Signature:
export declare class QuerySnapshot<T = DocumentData>
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
docs | Array<QueryDocumentSnapshot<T>> | An array of all the documents in the QuerySnapshot . |
|
empty | boolean | True if there are no documents in the QuerySnapshot . |
|
query | Query<T> | The query on which you called getDocs() in order to get this QuerySnapshot . |
|
size | number | The number of documents in the QuerySnapshot . |
Methods
Method | Modifiers | Description |
---|---|---|
forEach(callback, thisArg) | Enumerates all of the documents in the QuerySnapshot . |