typescript - 过滤顺序会影响 Firestore 中的查询结果吗?
问题描述
我有一个使用 where 子句获取一些 Firestore 数据的查询。(我正在使用angularfire2)
代码:
this.db.collection('trips', ref => ref.where('origin', '==', this.trip.origin)
.where('destination', '==', this.trip.destination)
.where('avaiableSeats', '>', 0))
我遇到的问题是,对于相同的数据,该查询不返回任何内容。
但是,如果我像这样更改目的地的来源:
this.db.collection('trips',ref=>ref.where('destination', '==', this.trip.destination)
.where('origin', '==', this.trip.origin)
.where('avaiableSeats', '>', 0))
突然,所有对象都正确返回。知道为什么或发生了什么吗?
解决方案
推荐阅读
- javascript - 如何在运行另一个承诺之前有条件地执行一个承诺?
- java - JavaFX 中的 JOGL 画布
- python - 如何在 python 脚本中使用 virtualenv,所以我们不需要每次都激活它
- assembly - Microsoft Assembler,为什么 PTR 不适用于寄存器(无效使用寄存器)
- scheme - 函数忽略范围内的第一个函数
- sqlite - 从 sqlite3 中的 url 中提取站点/域名
- python - 在不损失质量的情况下为图像添加黑色边框
- ios - 使用完成处理程序 IOS 从 Firebase 中的子项获取初始键值
- perl - 在 Perl 中动态存储变量
- wget - wget 仅在服务器上已更新文件时才重新下载文件