且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用子字符串查询Firebase密钥

更新时间:2023-02-20 23:33:14

正如Doug所说,无法查询包含某个字符串的值.但是您可以查询开头的某个子字符串的键:

As Doug says, there is no way to query for values that contain a certain string. But you can query for keys that start with a certain substring:

return catref.orderByKey().startAt("4140-").endAt("4140-\uf8ff").once('value').then(function(snapshot){

这只会匹配其键以4140-开头的子节点.

This will just match the child nodes whose key starts with 4140-.