voluptasmollitia
Version:
Monorepo for the Firebase JavaScript SDK
27 lines (15 loc) • 1.07 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@firebase/database](./database.md) > [DataSnapshot](./database.datasnapshot.md) > [child](./database.datasnapshot.child.md)
## DataSnapshot.child() method
Gets another `DataSnapshot` for the location at the specified relative path.
Passing a relative path to the `child()` method of a DataSnapshot returns another `DataSnapshot` for the location at the specified relative path. The relative path can either be a simple child name (for example, "ada") or a deeper, slash-separated path (for example, "ada/name/first"). If the child location has no data, an empty `DataSnapshot` (that is, a `DataSnapshot` whose value is `null`<!-- -->) is returned.
<b>Signature:</b>
```typescript
child(path: string): DataSnapshot;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| path | string | A relative path to the location of child data. |
<b>Returns:</b>
[DataSnapshot](./database.datasnapshot.md)