在firestoreConnect中使用查询进行过滤时,无法从firestore中检索数据

时间:2019-02-08 09:50:29

标签: reactjs redux react-redux

pandas df中使用查询进行过滤时,无法从Firestore中检索数据。以下是我的代码。有人可以帮我吗?

firestoreconnect

在控制台中,我得到:

const mapStateToProps = (state) => {
    console.log(state);
    return {
        joblists: state.firestore.ordered.Jobs
    };
}

export default compose(
    connect(mapStateToProps),
    firestoreConnect([{
        collection: 'Jobs',
        orderBy: ['postedon','desc'],
        where: ['postedby', '==', "Employer1"]
    }])
)(EmpJob); 

1 个答案:

答案 0 :(得分:0)

compose函数的顺序很重要。 firestoreConnect([...])应该是传入的第一个参数,后跟connect(mapStateToProps)

作为示例,请参见https://react-redux-firebase.com/docs/api/firestoreConnect.html上的底部示例。