voluptasmollitia
Version:
Monorepo for the Firebase JavaScript SDK
16 lines (9 loc) • 722 B
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@firebase/database](./database.md) > [DataSnapshot](./database.datasnapshot.md) > [key](./database.datasnapshot.key.md)
## DataSnapshot.key property
The key (last part of the path) of the location of this `DataSnapshot`<!-- -->.
The last token in a Database location is considered its key. For example, "ada" is the key for the /users/ada/ node. Accessing the key on any `DataSnapshot` will return the key for the location that generated it. However, accessing the key on the root URL of a Database will return `null`<!-- -->.
<b>Signature:</b>
```typescript
get key(): string | null;
```