DataSnapshot contains data from a Database location.
Any time you read data from the Database, you receive the data as a
is passed to the event callbacks you attach with
once(). You can extract the contents
into the snapshot by calling
child() to return child snapshots (which you could then call
The key (last part of the path) of the location of this
key: string | null;
DataSnapshot for the location at the specified relative path.
child(path: string): DataSnapshot;
Returns true if this
DataSnapshot contains any data. It is slightly more efficient than using snapshot.val() !== null.
Enumerates the top-level children in the
forEach(action: (child: DataSnapshot) => true | undefined): boolean;
Gets the priority value of the data in this DataSnapshot.
getPriority(): string | number | null;
Returns true if the specified child path has (non-null) data.
hasChild(path: string): boolean;
Returns whether or not the
DataSnapshot has any non-null child properties.
Returns the number of child properties of this DataSnapshot.
Returns a JSON-serializable representation of this object.
toJSON(): object | null;