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.

Type parameters

  • T

Index

Constructors

Properties

Methods

Constructors

Private constructor

Properties

docs

docs: Array<QueryDocumentSnapshot<T>>

An array of all the documents in the QuerySnapshot.

empty

empty: boolean

True if there are no documents in the QuerySnapshot.

metadata

Metadata about this snapshot, concerning its source and if it has local modifications.

query

query: Query<T>

The query on which you called get or onSnapshot in order to get this QuerySnapshot.

size

size: number

The number of documents in the QuerySnapshot.

Methods

docChanges

  • docChanges ( options ? :  SnapshotListenOptions ) : Array < DocumentChange < T > >
  • 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.

    Parameters

    • Optional options: SnapshotListenOptions

      SnapshotListenOptions that control whether metadata-only changes (i.e. only DocumentSnapshot.metadata changed) should trigger snapshot events.

    Returns Array<DocumentChange<T>>

forEach

  • forEach ( callback ( result QueryDocumentSnapshot < T > ) => void ,  thisArg ? :  any ) : void
  • Enumerates all of the documents in the QuerySnapshot.

    Parameters

    Returns void

isEqual

  • isEqual ( other QuerySnapshot < T > ) : boolean
  • Returns true if this QuerySnapshot is equal to the provided one.

    Parameters

    Returns boolean

    true if this QuerySnapshot is equal to the provided one.