3

Is there a possibility of removing multiple nodes from a Firebase Realtime database in one go? I can delete a record by giving the full path of the child node. But if I have multiple child node keys already, is there a way I can delete all of them at once?

1 Answer 1

11

You can remove multiple nodes in one go by using a multi-location update statement, and passing null for the values.

Something like:

const ref = firebase.database().reference();
ref.update({
  "/path/to/node/one": null,
  "/path/to/node/two": null,
  "/path/to/node/three": null
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.