I am trying to get some data from a database where I want only objects that contains a certain key/value pair to be returend.
Lets say this is the data
{
"times": {
"tuesday":[
{"moods":[
{"play" : "good"}
{"play" : "good"}
{"play" : "bad"}
{"play" : "okay"}
{"play" : "just right"}
]}
]
}
}
In Angular I have a fetch for the database that uses switch map to change the current path annd update
this.items$ = this.a_s.xc$.pipe(switchMap((x) => {
return this.db.list('fixtures/'+x).valueChanges();
}));
then I subscribe
this.items$.subscribe({next: (value) => {
console.log(value)
}
});
What I would like is to get all the objects where play == good . That’s in Times/Tuesday/Moods
I tried using some example I found online but quickly realized angular only allow those 1 level deep, for sure this is possible ?