在Firebase中查询数据时是否还有其他操作符? [英] Are there any more operators like ~ when querying data in Firebase

查看:110
本文介绍了在Firebase中查询数据时是否还有其他操作符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到firebase文档中的〜符号这里

I notice the '~' sign in the firebase documentation here

var ref = new Firebase("https://dinosaur-facts.firebaseio.com/dinosaurs");
ref.orderByKey().startAt("b").endAt("b~").on("child_added", function(snapshot) {
  console.log(snapshot.key());
});

是否还有其他表达式可以在firebase中使用?我很好奇,是否有像 .contains(string)这样的操作符,而不是获取所有的数据然后过滤数据。我试图让自己远离弹性搜索。

are there other expressions like '~' that can be use in firebase? I'm curious if there's a operator that acts like .contains(string) rather than fetching all then filter the data. I'm trying to keep my self away from elastic search.

推荐答案

据我所知,没有这样的事情Firebase API中的 .contains

As far as I know, there is no such thing as .contains in the Firebase API.

最好的办法是编写一个实用程序来获取数据和过滤器它适合你。

Your best bet is to write a utility function which fetches the data and filters it for you.

这篇关于在Firebase中查询数据时是否还有其他操作符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆