【发布时间】:2015-06-09 03:23:25
【问题描述】:
这是一个例子。 (注意:firebase中的数据是不变的。这是为了消除一个变量。换句话说,我加载了数据,现在它是静态的。)
我正在测试我是否从 orderByChild 调用中收到了正确的结果。
我在下面的 curl 命令中执行此操作。请注意,我正在按照@FrankvanPuffelen 的建议对返回值进行排序。
我每次将 orderby 查询中的限制增加一。
我希望看到上一个查询返回的上一个数据并添加一个新行。
但我看到数据显示在较大的限制中,而不是在较低的限制中。
查看从限制 5 到限制 6 的过渡:
限制 1
$ curl 'https://nysenate.firebaseio.com/bills.json?orderBy="publishedDateTime"&limitToFirst=1&print=pretty'|grep publishedDateTime|sort
"publishedDateTime" : "2015-06-05T09:16:05",
限制 2
$ curl 'https://nysenate.firebaseio.com/bills.json?orderBy="publishedDateTime"&limitToFirst=2&print=pretty'|grep publishedDateTime|sort
"publishedDateTime" : "2015-06-05T09:16:05",
"publishedDateTime" : "2015-06-05T09:16:05",
限制 3
$ curl 'https://nysenate.firebaseio.com/bills.json?orderBy="publishedDateTime"&limitToFirst=3&print=pretty'|grep publishedDateTime|sort
"publishedDateTime" : "2015-06-05T09:16:05",
"publishedDateTime" : "2015-06-05T09:16:05",
"publishedDateTime" : "2015-06-05T09:21:05",
限制 4
$ curl 'https://nysenate.firebaseio.com/bills.json?orderBy="publishedDateTime"&limitToFirst=4&print=pretty'|grep publishedDateTime|sort
"publishedDateTime" : "2015-06-05T09:16:05",
"publishedDateTime" : "2015-06-05T09:16:05",
"publishedDateTime" : "2015-06-05T09:21:05",
"publishedDateTime" : "2015-06-05T09:21:05",
限制 5
$ curl 'https://nysenate.firebaseio.com/bills.json?orderBy="publishedDateTime"&limitToFirst=5&print=pretty'|grep publishedDateTime|sort
"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",
限制 6
$ curl 'https://nysenate.firebaseio.com/bills.json?orderBy="publishedDateTime"&limitToFirst=6&print=pretty'|grep publishedDateTime|sort
"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-05T10:36:09",** **why did this not show in the previous query??**
"publishedDateTime" : "2015-06-05T11:21:11",
【问题讨论】:
标签: firebase