0

For example, I have a list like this, and I wanna search for objects which have the child "apple", is it doable?

[{id: 1, child:["apple", "tomato", "potato"]}, {id: 1, child:["potato"]}, ...]
Ian
  • 342
  • 1
  • 3
  • 14

1 Answers1

0

That's just basic Javascript ... You should be able to do it yourself. Otherwise, you should learn Javascript instead of Angular.

Nevertheless, use the according tags.

And here is your answer.

const apples = data.filter(item => item.child.includes('apple'));
MGX
  • 2,534
  • 2
  • 14
  • I know I could load all the data and filter it out. I was wondering if there is any way to do it on the firebase side. Thanks. – Ian Dec 20 '22 at 09:46