【发布时间】:2020-03-21 03:03:00
【问题描述】:
我正在用颤振构建一个应用程序,我想运行一个查询来确定我的 firestore 文档中的数组是否为空。有没有办法做到这一点?
这是我在 Firestore 中构建的数据的图片。
我知道有一个 arrayContains 方法,但我不确定如何检查 空数组。这是我当前的代码。
_postsStream = await _firestore
.collectionGroup('posts')
.where('timestamp', isGreaterThanOrEqualTo: _start)
.where('timestamp', isLessThanOrEqualTo: _end)
.where('problems', arrayContains: )
.snapshots();
我暂时将 arrayContains: 留空。请告知我将如何实现此功能。提前致谢!
【问题讨论】:
-
查看这个可能的解决方法stackoverflow.com/q/55287819/6002078
标签: firebase flutter dart google-cloud-firestore