Accéder à la console

A DocumentReference refers to a document location in a Firestore database and can be used to write, read, or listen to the location. The document at the referenced location may or may not exist. A DocumentReference can also be used to create a CollectionReference to a subcollection.

Index

Constructors

Private constructor

Properties

firestore

firestore: Firestore

The firebase.firestore.Firestore the document is in. This is useful for performing transactions, for example.

id

id: string

The document's identifier within its collection.

parent

The Collection this DocumentReference belongs to.

path

path: string

A string representing the path of the referenced document (relative to the root of the database).

Methods

collection

  • collection(collectionPath: string): CollectionReference
  • Gets a CollectionReference instance that refers to the collection at the specified path.

    Parameters

    • collectionPath: string

      A slash-separated path to a collection.

    Returns CollectionReference

    The CollectionReference instance.

delete

  • delete(): Promise<void>
  • Deletes the document referred to by this DocumentReference.

    Returns Promise<void>

    A Promise resolved once the document has been successfully deleted from the backend (Note that it won't resolve while you're offline).

get

  • get(options?: GetOptions): Promise<DocumentSnapshot>
  • Reads the document referred to by this DocumentReference.

    Note: By default, get() attempts to provide up-to-date data when possible by waiting for data from the server, but it may return cached data or fai