Reputation: 89
I have a folder for each user. I have a DataSnapshot name "snapshot" that selects an item of the user that has been changed. Using the following code, i get the snapshot for the item I want in the same user:
var locationSnapshot = snapshot.child("location");
This works. My question is how can I get the reference to this exact item in the database so that I can write it? Supposedly there is a function:
ref
non-null firebase.database.Reference
The Reference for the location that generated this DataSnapshot.
But when I use it, it doesn't work:
var locationReference = locationSnapshot.ref();
Question: How do I use it or how do I get the reference?
Upvotes: 0
Views: 2197