The Firebase JS SDK is now in BETA!
This EAP site is no longer maintained. See the official Firebase Documentation site for the latest documentation and information about the Firebase JS SDK.

Home > @firebase/database > DataSnapshot > child

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.

Signature:

child(path: string): DataSnapshot;

Parameters

Parameter Type Description
path string A relative path to the location of child data.

Returns:

DataSnapshot