答案 0 :(得分:1)
您可以通过运行查询来执行此操作:
var ref = new Firebase("https://yours.firebaseio.com/users");
var query = ref.orderByChild('username').equalTo('tom');
query.once('value', function(snapshot) {
snapshot.forEach(function(tomSnapshot) {
console.log('We found a tom with uid: '+tomSnapshot.key());
});
});
Firebase documentation on queries中介绍了这一点,非常值得一读。