AbAppletic AbAppletic - 1 year ago 84
Android Question

Firebase - Is there a method for returning to root in Firebase?

Let's say I have this database:

name: "Hello SO"

And currently, I am at "name" (by

So, how can I return to the root of the tree? (In this case, "Database")

Answer Source

You can get a root reference by calling the root function from any child reference:

var rootReference = database.child("-Blah1").child("name").getRoot();