【发布时间】:2022-01-03 19:11:17
【问题描述】:
这是我的目标
readUserIDS:[
0: ID1
1:ID2
]
或
readUserIDS:[
0: ID1
]
我只想渲染具有 1 个 ID 的数组,但我不知道如何使用 firestore 查询我的数组。基本上,我只想找到一个 ID 的 array.length
const notification = () => {
channelsRef
.where('channelID', '==', item.id)
.get()
.then((querySnapshot) => {
querySnapshot.forEach((doc) => {
doc.ref
.collection('thread')
.where('senderID', '==', item.participants[0].id)
.where('readUserIDs.2', '>', '')
.get()
.then((querySnapshot) => {
console.log('size', querySnapshot.size);
querySnapshot.forEach((thread) => {
let data = querySnapshot.size;
console.log('data', data);
});
});
});
});
};
【问题讨论】:
标签: react-native google-cloud-firestore