Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
对Firebase rest api进行分页_Rest_Firebase_Firebase Realtime Database - Fatal编程技术网

对Firebase rest api进行分页

对Firebase rest api进行分页,rest,firebase,firebase-realtime-database,Rest,Firebase,Firebase Realtime Database,我正在使用Firebase REST API获取数据。我得到的数据如下 [ { "date_time" : "2018-01-03 03:30:00", "domestic" : "0", "f_key" : "", "id" : 2, "international" : "1", "league" : "0", "match_number" : "One-day practice match", "men" : "1", "odi" : "1", "re

我正在使用Firebase REST API获取数据。我得到的数据如下

[ {
  "date_time" : "2018-01-03 03:30:00",
  "domestic" : "0",
  "f_key" : "",
  "id" : 2,
  "international" : "1",
  "league" : "0",
  "match_number" : "One-day practice match",
  "men" : "1",
  "odi" : "1",
  "result" : "Pakistan won by 120 runs",
  "series_name" : "Pakistan tour of New Zealand, 2018",
  "status" : "2",
  "t1_short_name" : "NZ",
  "t20" : "0",
  "t2_short_name" : "PAK",
  "team1" : "New Zealand",
  "team1_flag" : "https://storage.googleapis.com/ce_flags/nz.png",
  "team2" : "Pakistan",
  "team2_flag" : "https://storage.googleapis.com/ce_flags/pak.png",
  "test" : "0",
  "venue" : "Saxton Oval, Nelson",
  "women" : "0"
}, {
  "date_time" : "2018-01-03 03:30:00",
  "domestic" : "0",
  "f_key" : "",
  "id" : 159,
  "international" : "1",
  "league" : "0",
  "match_number" : "One-day practice match",
  "men" : "1",
  "odi" : "1",
  "result" : "Pakistan won by 120 runs",
  "series_name" : "Pakistan tour of New Zealand, 2018",
  "status" : "2",
  "t1_short_name" : "NZ",
  "t20" : "0",
  "t2_short_name" : "PAK",
  "team1" : "New Zealand",
  "team1_flag" : "https://storage.googleapis.com/ce_flags/nz.png",
  "team2" : "Pakistan",
  "team2_flag" : "https://storage.googleapis.com/ce_flags/pak.png",
  "test" : "0",
  "venue" : "Saxton Oval, Nelson",
  "women" : "0"
} ]
但是,当我试图对它们分页时,它不起作用,我就是这样使用的

https://fir-resttest-4e895.firebaseio.com/Fixtures/All.json?orderBy=%22date_time%22&limitToFirst=2&startAfter=10&print=pretty
我如何在这里使用分页请帮我整理一下


谢谢,Firebase数据库查询不支持您可能习惯的偏移量参数

startAt
传递的值必须是
orderBy
中的属性类型/格式的值。由于您在
date\u-time
下订单,
startAt
的值必须是有效的
date\u-time

这将为您提供从2018-01-03 03:30:00开始的所有项目

orderBy="date_time"&limitToFirst=2&startAt="2018-01-03 03:30:00"
还要注意,该参数称为
startAt
,而不是
startAfter

数据集的一些示例:

  • (因此也可以从子字符串开始)

这似乎与这个问题无关。如果您有自己的问题,请发布一个新的问题。