我在firebase中有相对大量的数据:https://nysenate.firebaseio.com/
问题是如何按顺序获得结果。
例如,对于100K对象的firebase,我希望在整个集合按publishedDateTime排序后得到前10个。
但是如果你看结果,它似乎根本没有排序。事实上,我无法真正说出订单是什么。
(这些都是公共读取的火灾基础,因此您可以使用相同的curl命令进行测试)
$ curl 'https://nysenate.firebaseio.com/bills.json?orderBy="publishedDateTime"&limitToFirst=10&print=pretty' |grep publishedDateTime
"publishedDateTime" : "2015-06-05T09:16:05",
"publishedDateTime" : "2015-06-05T09:16:05",
"publishedDateTime" : "2015-06-05T09:21:05",
"publishedDateTime" : "2015-06-05T09:21:05",
"publishedDateTime" : "2015-06-05T11:21:11",
"publishedDateTime" : "2015-06-05T10:36:09",
"publishedDateTime" : "2015-06-05T13:56:18",
"publishedDateTime" : "2015-06-05T11:16:11",
"publishedDateTime" : "2015-06-05T13:51:18",
"publishedDateTime" : "2015-06-05T13:46:18",
它似乎适用于少量数据:( 6个物体)使用其中一个示范火焰基地。
$ curl 'https://dinosaur-facts.firebaseio.com/dinosaurs.json?orderBy="height"&limitToFirst=10&print=pretty' |grep height
"height" : 0.6,
"height" : 0.6,
"height" : 2.1,
"height" : 3,
"height" : 4,
"height" : 25,