Firebase Realtime Javascript SDK : orderByChild and equalTo not working with string like “+123”

白昼怎懂夜的黑 提交于 2021-01-29 22:56:21

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!