我试图只检索一个记录列表,按每个记录中的一个字段排序,我希望能够检索页面中的数据.
根据Firebase文档,该reference.startAt()方法有一个可选的第二个参数,它是:
The child key to start at. This argument is only allowed if ordering by child, value, or priority.
首先,这是数据:
{
"products" : {
"-KlsqFgVWwUrA-j0VsZS" : {
"name" : "Product 4",
"price" : 666
},
"-Klst-cLSckuwAuNAJF8" : {
"name" : "Product 1",
"price" : 100
},
"-Klst7IINdt8YeMmauRz" : {
"name" : "Product 2",
"price" : 50
},
"-Klst9KfM2QWp8kXrOlR" : {
"name" : "Product 6",
"price" : 30
},
"-KlstB51ap1L2tcK8cL6" : {
"name" : "Product 5", …Run Code Online (Sandbox Code Playgroud)