Actually, there are two different types of objects. A Firebase and DataSnapshot . When you call a new Firebase (), you get a Firebase link that allows you to write data (for example, using set or setPriority) or attach callbacks to read data (for example, using once or once).
These callbacks registered with on () or once () receive data through DataSnapshot, and you can call it .getPriority (). See Reading Data for more information .
For example, for your example to work, you could do something like:
var winner = "somebody"; var playersListRef = new Firebase('https://myfirebase.firebaseIO.com/players') var winnerRef = playersListRef.child(winner);
source share