I'm trying to set a listener with redux-firestore that queries firestore documents that has nested properties like this: users.USER_EMAIL.role. I need to be able to insert a variable in the where parameter of the query. I have done this previously using FieldPath without hooking up redux, but can't seem to make it work with redux-firestore.
Here's how I would do it before, which works fine:
db.collection('projects').where(new firebase.firestore.FieldPath('users', email, 'role'), '==', 'owner')
This is what I'm trying to do now, which fails:
store.firestore.setListener({ collection: 'projects', where: [[new firebase.firestore.FieldPath('users', this.props.email, 'role'), '==', 'owner']] })
I'm getting this error:
Error: where parameter must be an array.
The where parameter looks like an array to me. What am I missing? Is it even possible to use FieldPath with redux-firestore?
Thanks!