delete
Remove data from a specific path in the Realtime Database.
Overview
The delete method removes all data at the specified path, including its child nodes. This is equivalent to calling set with null.
Deleting data
import { db } from 'refirebase';
const result = await db.realtime.delete('sessions/session456');
if (result?.error) {
console.error('Failed to delete data:', result.error);
} else {
console.log('Data deleted successfully!');
}
Parameters
| Param | Type | Description |
|---|---|---|
path* | string | The path to the data in the Realtime Database. |
Return value
Returns
Promise<undefined | { error: unknown }>Returns undefined on success, or an error object if the operation fails.