我有一组文档 ID。我想使用数组中的 ID 从 firestore 获取这些文档。换句话说,我需要遍历 ID 数组并使用相应的 ID 查询每个文档。
所以目前这就是我查询的方式。我正在查询“属性”集合中的所有文档。
export default compose(
connect(mapStateToProps, mapDispatchToProps),
firestoreConnect((props) => {
if (!props.auth.uid) {
props.history.push('/signin')
return []
}
return [
{
collection: 'Properties',
},
{
collection: 'Properties',
doc: propid
},
{
collection: 'Partners',
doc: props.auth.uid,
subcollections: [{
collection: 'MyInvites',
},
]
},
{
collection: 'Partners',
doc: props.auth.uid,
subcollections: [{
collection: 'ReceivedInvites',
}
]
},
{
collection: 'Partners',
doc: props.auth.uid,
},
]
}
)
目标是按 ID 从“属性”集合中获取特定文档。我要查询的文档的 ID 在一个数组中。
例如
let idArray=[doc0id,doc1id,doc2id,doc3id,....docnid]
有没有办法做到这一点?