Options
All
  • Public
  • Public/Protected
  • All
Menu

Class QuerySnapshot<T>

A wrapper around the Firestore QuerySnapshot class.

Type parameters

Hierarchy

  • QuerySnapshot

Implements

Index

Constructors

Accessors

Methods

Constructors

constructor

  • Creates a query snapshot from firestore snapshot.

    Parameters

    • nativeSnapshot: QuerySnapshot

      The native query snapshot.

    • Entity: object

      The entity to represention.

    • collection: ICollection<T>

      The collection for the entity.

    • query: Query<T>

      The query which was run.

    Returns QuerySnapshot

Accessors

docs

  • get docs(): T[]
  • The docs in the snapshot.

    Returns T[]

empty

  • get empty(): boolean
  • Whether or not the snapshot is empty.

    Returns boolean

metadata

  • get metadata(): SnapshotMetadata
  • The snapshot metadata.

    Returns SnapshotMetadata

query

  • The query which resulted in the snapshot.

    Returns Query<T>

size

  • get size(): number
  • The number of docs in the snapshot.

    Returns number

Methods

docChanges

  • docChanges(opts?: firestore.SnapshotListenOptions): DocumentChange<T>[]
  • Returns an array of the document changes since the last snapshot.

    Parameters

    • Optional opts: firestore.SnapshotListenOptions

      Options to control what type of changes to include in the results.

    Returns DocumentChange<T>[]

forEach

  • forEach(callback: function): void
  • Executes a callback function on the snapshot docs.

    Parameters

    • callback: function

      The function to run on each doc.

        • (doc: T, index: number): void
        • Parameters

          • doc: T
          • index: number

          Returns void

    Returns void

Generated using TypeDoc