QuerySnapshot
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.
class QuerySnapshot<AppModelType = DocumentData, DbModelType extends DocumentData = DocumentData> { }
private constructor();
get empty(): boolean;
get size(): number;
forEach(callback: (result: QueryDocumentSnapshot<AppModelType, DbModelType>) => void, thisArg?: unknown): void;
§Type Parameters
§
AppModelType = DocumentData
[src]§
DbModelType extends DocumentData = DocumentData
[src]§Properties
§
docs: Array<QueryDocumentSnapshot<AppModelType, DbModelType>> readonly
[src]An array of all the documents in the QuerySnapshot
.
§
metadata: SnapshotMetadata
[src]Metadata about this snapshot, concerning its source and if it has local modifications.
§Methods
§
docChanges(options?: SnapshotListenOptions): Array<DocumentChange<AppModelType, DbModelType>>
[src]Returns an array of the documents changes since the last snapshot. If this is the first snapshot, all documents will be in the list as 'added' changes.
@param options
SnapshotListenOptions
that control whether metadata-only changes (i.e. onlyDocumentSnapshot.metadata
changed) should trigger snapshot events.
§
forEach(callback: (result: QueryDocumentSnapshot<AppModelType, DbModelType>) => void, thisArg?: unknown): void
[src]Enumerates all of the documents in the QuerySnapshot
.
@param callback
- A callback to be called with a
QueryDocumentSnapshot
for each document in the snapshot.
@param thisArg
- The
this
binding for the callback.