You're viewing the legacy docs. They are deprecated as of May 18, 2016.
These docs are for version 2.4.2 and below of the Javascript SDK. Go to our current docs, or see our Web migration guide.

Version 2.4.2Changelog


Remove the data at this database location. Any data at child locations will also be deleted.

The effect of the delete will be visible immediately and the corresponding events ("value", "child_removed", etc.) will be triggered. Synchronization of the delete to the Firebase servers will also be started, and if provided, the onComplete callback will be called asynchronously after synchronization has finished.

remove() is equivalent to calling set(null).

var fredRef = new Firebase('');

// All data at the database location for user 'fred' has been deleted
// (including any child data)
var onComplete = function(error) {
  if (error) {
    console.log('Synchronization failed');
  } else {
    console.log('Synchronization succeeded');

// Same as the previous example, except we will also log
// a message when the delete has finished synchronizing