ios - Firestore“array-contains-any”不起作用
问题描述
我正在尝试在 iOS (Swift) 上使用 Firestore 查询:
db.collection(FS_PICS)
//.whereField("category", arrayContains: "Animals")
.whereField("category", arrayContains: ["Animals", "Dogs"])
.getDocuments() { (querySnapshot, err) in
if let err = err {
print("Error getting documents: \(err)")
} else {
for document in querySnapshot!.documents {
print("\(document.documentID) => \(document.data())")
}
}
}
它不返回任何结果
// doesn't work
.whereField("category", arrayContains: ["Animals", "Dogs"])
或与
// doesn't work
.whereField("category", in: ["Animals", "Dogs"])
但我有 8 个结果:
// It works!!
.whereField("category", arrayContains: "Animals")
它不像 OR 甚至不像 AND 那样工作,因为它也不起作用:
// It works!!
.whereField("category", arrayContains: ["Animals"])
那么这个函数的想法是什么,我应该怎么做才能得到 OR ?
解决方案
推荐阅读
- java - 在休眠中将“反引号”添加到列名
- spring-boot - Spring Sidecar 应用程序无法发现 Eureka 服务器
- reactjs - Axios AWS S3 放置对象:错误:网络错误
- tensorflow - 通过谷歌对象检测 API 重新训练时出现超出范围错误
- pyspark - Zeppelin:与字符串混合时有问题的表格显示
- python - 根据用户操作在字典中显示下一个键 - python
- python - OpenCV-python 训练-LBPH 识别器
- python - QComboBox 项目中的颜色代替 QIcons
- php - 在 cURL 结果上使用 json_decode
- html - 要添加什么来防止我的内容随着浏览器大小而缩小?
我应该在我的 html/css 代码中添加什么,以便在我最小化浏览器大小时标签下的内容不会不合适?
内容涉及左侧栏的图片和右侧的文字。当我操纵浏览器的大小时,文本是无处不在的。
我的代码:
<table cellspacing="40px;"> <tr> <td> <img src="xx.jpg" widt