我在我的數據庫中的隊列,看起來像這樣:如何獲得瞬間的孩子不知道在火力和火力管理員的關鍵
server
queue
-RANDOM_ID_1234
active: "true"
text: "Some text"
-RANDOM_ID_5678
active: "false"
text: "Another text"
-RANDOM_ID_91011
active: "false"
text: "Text that does not matter"
我要查詢和獲取活動項目:
queueRef.orderByChild('active').equalTo('true').once('value', function(snap) {
if (snap.exists()) {
console.log(snap.val());
}
});
console.log
將返回類似:
{
-RANDOM_ID_1234: {
active: "true"
text: "Some text"
}
}
如何獲取文本不知道關鍵?
我使用lodash(請參閱下面的答案),但必須有更好的方法來做到這一點。
將是真棒。 – Pier