我有一个firebase数据库:
class MyComponent implements CanReuse {
routerCanReuse(nextInstruction: ComponentInstruction, prevInstruction: ComponentInstruction) {
return true;
}
}
我想检索名字的记录=" Seema" 我正在运行以下查询:
contacts:{
"123": {
"email": "priya@gmail.com",
"name": "Priya"
}
"679": {
"email": "seema@gmail.com",
"name": "Seema"
}
}
但是控制台输出为null:
匹配名称= Priya null的帐户
答案 0 :(得分:2)
你可以试试这个:
var ref = new Firebase("https://teststack.firebaseio.com/contacts");
ref.orderByChild('name').equalTo('Priya').once('value', show);
function show(snap) {
console.log(JSON.stringify(snap.val(), null, 2));
}