{
"foo":{
"uid":{
"push_key_1":{
"bar":"baz"
},
"push_key_2":{
"bar":"baz"
}
}
}
}
Given the code model above, how do I dynamically search push_key_1or push_key_2in a query?
I have tried:
var searKey = 'push_key_1';
db.ref('foo').orderByKey().equalTo(searKey).once('value')
.then(function(snap){
}).catch();
But snap.val()- null. Turns off is orderByKey()intended only for sorting. Is there any way to achieve this?
source
share