I am providing database structure image where parentId is unknown and child Id is known as shown in image. how do I get all data inside this child Id lie date and contents of orders. I know code is wrong. But fetching just Order huge data and then comparing to this id will be not efficient.
let grabbedData = [];
firebase
.database()
.ref(`/orders/`) // or may be like this '/orders/CHILD/-MOzRqdxsBROTleyr1ct/'
.child("-MOzRqdxsBROTleyr1ct")
.on("value", (snapshot, key) => {
console.log("snapshot....", snapshot);
grabbedData.push(snapshot.val());
});