A DatabaseReference represents a specific location in your Database and can be used for reading or writing data to that Database location.

You can reference the root or child location in your Database by calling ref() or ref("child/path").

Writing is done with the set() method and reading can be done with the on*() method. See https://firebase.google.com/docs/database/web/read-and-write

Hierarchy

Properties

Methods

Properties

key: null | string

The last part of the DatabaseReference's path.

For example, "ada" is the key for https://<DATABASE_NAME>.firebaseio.com/users/ada.

The key of a root DatabaseReference is null.

parent: null | DatabaseReference

The parent location of a DatabaseReference.

The parent of a root DatabaseReference is null.

The DatabaseReference for the Query's location.

The root DatabaseReference of the Database.

Methods

  • Returns whether or not the current and provided queries represent the same location, have the same query parameters, and are from the same instance of FirebaseApp.

    Two DatabaseReference objects are equivalent if they represent the same location and are from the same instance of FirebaseApp.

    Two Query objects are equivalent if they represent the same location, have the same query parameters, and are from the same instance of FirebaseApp. Equivalent queries share the same sort order, limits, and starting and ending points.

    Returns

    Whether or not the current and provided queries are equivalent.

    Parameters

    • other: null | Query

      The query to compare against.

    Returns boolean

  • Returns a JSON-serializable representation of this object.

    Returns

    A JSON-serializable representation of this object.

    Returns string

  • Gets the absolute URL for this location.

    The toString() method returns a URL that is ready to be put into a browser, curl command, or a refFromURL() call. Since all of those expect the URL to be url-encoded, toString() returns an encoded URL.

    Append '.json' to the returned URL when typed into a browser to download JSON-formatted data. If the location is secured (that is, not publicly readable), you will get a permission-denied error.

    Returns

    The absolute URL for this location.

    Returns string

Generated using TypeDoc