我正在使用react-redux-firebase
在我的React应用中处理Firebase身份验证。我的身份验证使用以下命令自动填充users
中的firestore
集合:
export const rfConfig = {
userProfile: 'users',
useFirestoreForProfile: true
}
然后,我尝试从Firestore中的users
集合中获取特定用户,但问题是,我的状态似乎一次只填充了一个用户,而不是一次全部填充。下图演示了这一点:
我得到的收藏如下:
useFirestoreConnect([
{
collection: 'featured_mentors',
limit: 20,
storeAs: 'featured'
},
{
collection: 'users',
storeAs: 'mentors'
}
])
const test = useSelector(
state => state.firestore.ordered['mentors']
)
奇怪的是,我能够使用相同的方法来获取所有其他集合,而我的users
集合一次只能返回一个数据。知道为什么会这样或如何正确查询用户吗?