firebase react query code example
Example: firestoreConnect query
firestoreConnect((props) => {
let propertyDocRef = firebase.firestore().collection('properties').doc(props.propertyId)
if (!props.propertyId) return []
return [
{
collection : 'properties',
doc : props.propertyId,
subcollections : [
{ collection: 'tasks' }
],
storeAs : 'tasks',
orderBy : [
'createdAt',
'desc'
]
},
{
collection : 'likes',
where : [
[
'property',
'==',
propertyDocRef
]
]
}
]
})