问题
Using the Javascript SDK and this sample firebase database, with an index on "mobile" :
test
A
mobile : "+1234567"
B
mobile : "+2345678"
Now I want to query all nodes with mobile = "+1234567"
firebase.database().ref("test").orderByChild("mobile").equalTo("+1234567").once('value', function(snapshot) {
console.log(snapshot.val());
});
output : null
I asked this exact same question for REST API (resolved) : Firebase Realtime equalTo not working with String like "+123"
But can not get it working with the javascript SDK.
Thanks !
来源:https://stackoverflow.com/questions/65926152/firebase-realtime-javascript-sdk-orderbychild-and-equalto-not-working-with-str