Is there a way to Query a collection which is a grandchild in firebase?
Current firebase structure:
{
products: {
"dfwojozijowjfoije": {
"barcodes": ["12345", "5678"],
"productName": "someProduct"
},
"sdafsdasdfasdfadsf": {
"barcodes": ["99999", "88888"],
"productName": "someProduct2"
}
}
}
Current Query that I use:
await firebase
.database()
.ref('products')
.orderByChild('barcodes')
.equalTo('88888')
.on('value', snapshot => {
setProductName(snapshot.val())
}
)