Im trying to create a query to get a firestore collection/doc where userId is equal to the current userId or current userId is equal to contributorsId.
export default compose(
connect(mapStateToProps),
firestoreConnect((props) => {
if (!props.auth.uid) return []
return [
{
collection: 'canvases',
orderBy: ['createdAt', 'desc'],
where: [
['userId', '==', props.auth.uid] || ['contributors', 'array-contains', props.auth.uid]
],
}
]
})
)(CanvasSelector);
I want it to give me all docs where the statements are true. But it only returns the first one. If I choose to only include either one of the queries ("where") they both work and returns the correct docs.