voluptasmollitia
Version:
Monorepo for the Firebase JavaScript SDK
28 lines (17 loc) • 1.57 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@firebase/database](./database.md) > [Reference](./database.reference.md)
## Reference interface
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 `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](https://firebase.google.com/docs/database/web/read-and-write)
<b>Signature:</b>
```typescript
export declare interface Reference extends Query
```
<b>Extends:</b> [Query](./database.query.md)
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [key](./database.reference.key.md) | string \| null | The last part of the <code>Reference</code>'s path.<!-- -->For example, <code>"ada"</code> is the key for <code>https://<DATABASE_NAME>.firebaseio.com/users/ada</code>.<!-- -->The key of a root <code>Reference</code> is <code>null</code>. |
| [parent](./database.reference.parent.md) | [Reference](./database.reference.md) \| null | The parent location of a <code>Reference</code>.<!-- -->The parent of a root <code>Reference</code> is <code>null</code>. |
| [root](./database.reference.root.md) | [Reference](./database.reference.md) | The root <code>Reference</code> of the Database. |