javascript - Query specific day in Firestore
问题描述
I'm trying to query for a specifing date in Firestore. Until now I have tried this code:
let ref = db.collection('schools').doc('DglhflywuybkOuCq7tGW')
let start = new Date('2018-04-27')
let end = new Date('2018-04-28')
let reportRef = ref.collection('reportes').where('date', '>', start).where('date', '<', end)
In this code I need two variables, one for storing the start day (the one I'm looking) and the end, which is the start plus 1 day more. After that I query for the intersection of the two.
Is this the right way or there is a simpler way?
解决方案
推荐阅读
- aws-lambda - 无服务器框架始终需要阶段参数
- javascript - 想在游戏开始前选择角色
- javascript - React 计算器 - 等号逻辑
- java - Jersey 中的会话变量 (Java/JBoss)
- codeigniter - 有没有办法在codeigniter中通过电子邮件发送pdf而不使用jsPDF的phycial pdf文件
- angular - 在 Angular 中从表中搜索值
- windows - Windows CMD - 将输出保存到文件而不隐藏在控制台中
- ios - 如何在应用增加边界宽度的自定义渲染时保留 ArcGIS 地图中填充的颜色
- javascript - NSIS - js文件解压需要很长时间
- sql - 请求 sql COUNT 不归零