angular - Firestore orderBy 布尔值和时间戳
问题描述
我有一个场景,我需要根据布尔值和时间戳字段对集合中的记录进行分页。所以像:
collection('jobs', ref =>
ref.orderBy('asap', 'desc')
.orderBy('posted')
.startAfter(offset)
.limit(this.batchSize)
asap
是一个布尔值,posted
是时间戳。
基本上我需要显示一个记录列表,其中列表中的第一条记录是asap=true
那些,然后这些应该按发布日期排序。该列表继续包含具有asap=false
的记录,当然所有这些都应按发布日期排序。
我怎样才能做到这一点?
解决方案
推荐阅读
- reactjs - 在 React 路由器 dom 导航上出现错误无法在“节点”上执行“insertBefore”?
- android - Flutter 备份用户数据
- cobol - 编写 COBOL 程序来反转记录并从一个文件移动到另一个文件的逻辑是什么?
- python-3.x - structlog 无法添加处理程序以写入文件
- statistics - 如何在 Metabase 中找到带有数字的列的众数和中位数?(Metabase 是一种 BI 工具)
- android - 将 FlutterFragment 添加到 Activity 中?
- javascript - 数据切换引导折叠复选框问题
- java - 正则表达式匹配不以 001 或 002 开头的字符串
- gradle - 子依赖模块中的 Gradle 库依赖关系
- java - 如果文件已经下载,如何防止从 url 下载文件