【发布时间】:2021-01-02 08:16:53
【问题描述】:
我有group 收藏。在每个group 文档中,我通过firebase 中的成员数组字段存储了哪些用户与该组相关联。
例如:user1 & user2 在 xyz(id) 组中,我想从客户端查询以获取所有组拥有 user1 和 user2 (不是 OR )。我试过 firebase IN 数组查询,但它返回空结果。有没有办法使用 AND 进行查询,我正在使用 react native 制作聊天应用程序。
我的代码(不工作:)
firestoreRef.collection('group').where('members','in',[ id_of_user1, id_of_user2 ]).get(); // return empty array
【问题讨论】:
标签: javascript node.js firebase react-native google-cloud-firestore