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 > hasChild

DataSnapshot.hasChild() method

Returns true if the specified child path has (non-null) data.

Signature:

hasChild(path: string): boolean;

Parameters

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

Returns:

boolean

true if data exists at the specified child path; else false.