Firebase REST API:如何通过优先级获取数据,如JS中的startAt / endAt? [英] Firebase REST API: How to fetch data by priority like startAt/endAt in JS?

查看:110
本文介绍了Firebase REST API:如何通过优先级获取数据,如JS中的startAt / endAt?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要通过优先级范围获取数据,就像在JS中使用startAt / endAt一样,但是在REST中。是否有可能?

I need to fetch my data by a priority range, like you can with startAt/endAt in the JS, but in REST. Is it possible?

推荐答案

我相信现在可以使用beta查询API了。

I believe this is now possible with the beta Queries API.

按照 https://www.firebase.com/docs /beta/queries/rest.html
$ b

As per https://www.firebase.com/docs/beta/queries/rest.html:


startAt参数接受您在orderBy中指定的任何类型。
这个查询查找至少3米高的所有恐龙。

The startAt parameter accepts whatever type you specify in orderBy. This query finds all dinosaurs at least 3 meters tall.

curl 'https://dinosaur-facts.firebaseio.com/.json?orderBy="height"&startAt=3'

所有以剑龙为起点的恐龙。

And this query finds all dinosaurs starting with Stegosaurus.

curl 'https://dinosaur-facts.firebaseio.com/.json?orderBy="$key"&startAt="stegosaurus"'


这篇关于Firebase REST API:如何通过优先级获取数据,如JS中的startAt / endAt?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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