javascript - orderBy 不使用 .startAfter(this.lastInResponse)
问题描述
我正在使用分页。On ngOnInit()
,它正在按预期以正确的顺序获取数据,请参见下面的代码 -
this.firestore.collection('complaints' , ref => ref
.where("complaint_status", "==", "Open")
.limit(8)
.orderBy('ticketid', 'desc')
).snapshotChanges()
.subscribe(response => {
但是当我尝试NextPage()
使用下面的代码点击功能时,我没有收到任何结果
nextPage(){
console.log("show next. data");
this.disable_next = true;
this.firestore.collection('complaints', ref => ref
.where("complaint_status", "==", "Open")
.limit(8)
.orderBy('ticketid', 'desc')
.startAfter(this.lastInResponse)
).get()
为什么我在这里没有得到任何结果?请注意,如果我删除 order by,我会得到结果,但不会在 nextpage 函数中使用它。
解决方案
推荐阅读
- c++ - 在另一个类中使用 QNetworkRequest
- c++ - 从由 const 模板参数参数化的类型转换为非 const 模板参数
- python - 过量创建窗口时窗口立即关闭
- azure - 停止 Azure Cloud 上 Azure Function 的侦听器“Microsoft.Azure.WebJobs.Extensions.CosmosDB.CosmosDBTriggerListener”
- java - 尝试在 android studio 的适配器类中返回列表大小时发生错误
- django - Django field.choices + HTML。我如何获得单词显示,而不是 id?
- sql - 插入,即使是空白
- neo4j - 比较 neo4j 密码查询中的列表
- php - 如果发生 PHP 内存不足错误,如何获得实时警报?
- nearprotocol - 测试网浏览器上的交易状态为“未启动”