gpt4 book ai didi

Flutter Firestore : specific documents from a collection (Firestore. collection.where)

转载 作者:IT王子 更新时间:2023-10-29 07:05:45 24 4
gpt4 key购买 nike

我正在使用 Firebase Cloud Firestore,我想从集合中挑选特定文档。我想调用 permission 字段为 'everyone' 或 'groupA' 的文档。

stream: Firestore.instance
.collection('Posts')
.orderBy('date')
.where('permission', isEqualTo: 'everyone')
.where('permission', isEqualTo: 'groupA')
.snapshot(),

我试过了,但它试图给我带来交集。我也试过:

    .where('permission', arrayContains: 'everyone')
.where('permission', arrayContains: 'groupA')

但这给了我错误。

最佳答案

Firebase 不支持逻辑或查询。在这种情况下,您应该为每个 OR 条件创建一个单独的查询,并将查询结果合并到您的应用中。

关于Flutter Firestore : specific documents from a collection (Firestore. collection.where),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53196381/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com