Oracle® Backend For Firebase JavaScript Namespace SDK Reference, Release 26.1.0
    Preparing search index...
    Oracle® Backend For Firebase JavaScript Namespace SDK Reference
    Release 26.1.0

    G48197-02

    A QueryDocumentSnapshot contains data read from a document in your database as part of a query. The document is guaranteed to exist and its data can be extracted with .data() or .get(<field>) to get a specific field.

    A QueryDocumentSnapshot offers the same API surface as a DocumentSnapshot. Since query results contain only existing documents, the exists property will always be true and data() will never return 'undefined'.

    Type Parameters

    • T = any

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    exists: boolean

    True if the document exists.

    id: string

    The ID of the document for which this DocumentSnapshot contains data.

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

    A DocumentReference to the document location.

    Methods

    • Retrieves all fields in the document as an Object.

      Returns T

      An Object containing all fields in the document.

    • Retrieves the field specified.

      Parameters

      Returns any

      Field value or null.

      Throws an error if document does not exist or invalid field name.

    • Checks whether this DocumentSnapshot is equal to the provided one.

      Parameters

      Returns boolean

      True if equal, false otherwise.

      Throws an error if snap is not a DocumentSnapshot instance.