Go to console

A Reference 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 firebase.database().ref() or firebase.database().ref("child/path").

Writing is done with the set() method and reading can be done with the on() method. See Read and Write Data on the Web




key: string | null

The last part of the Reference's path.

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

The key of a root Reference is null.

// The key of a root reference is null
var rootRef = firebase.database().ref();
var key = rootRef.ke