Let's say I have this data on my Firebase:
https://mygame.firebaseio.com/player
{
"player": {
"bloodgulf01": {
"username": "bloodgulf01",
"uid": "twitter:102032",
"level": 2,
"map": 3,
"x": 51,
"y": 12
},
"damjanovic": {
"username": "damjanovic",
"uid": "github:77371",
"level": 5,
"map": 2,
"x": 21,
"y": 44
}
}
}
How would I search by uid
and get that result's snapshot
?
Here's what I have tried:
new Firebase("https://mygame.firebaseio.com/player")
.startAt(authData.uid)
.endAt(authData.uid)
.once('value', function(snap) {
console.log('accounts matching UID of ' + authData.uid, snap.val())
});
Which returns: accounts matching UID of github:123456789 null
despite having the uid
inside that data of /player/
...