Home > @firebase/database > ref
ref() function
Returns a Reference
representing the location in the Database corresponding to the provided path. If no path is provided, the Reference
will point to the root of the Database.
Signature:
export declare function ref(db: FirebaseDatabase, path?: string): Reference;
Parameters
Parameter | Type | Description |
---|---|---|
db | FirebaseDatabase | The database instance to obtain a reference for. |
path | string | Optional path representing the location the returned Reference will point. If not provided, the returned Reference will point to the root of the Database. |
Returns:
If a path is provided, a Reference
pointing to the provided path. Otherwise, a Reference
pointing to the root of the Database.