I'd like to retrieve all instances where the targetUser is Johnny.
The problem is that Firebase doesn't let me have .child() as null.
How can I do this?
This was my attempt -
readTargetUser = () => {
allHistory = [];
let myHistory = firebase
.database()
.ref("/locations")
.child()
.child("targetUser" === "Johnny")
.limitToLast(5);
myHistory.on("value", snapshot => {
console.log(
"Here I can see all info where the targetUser is Johnny",
snapshot
);
});
};