Add tags in firestore and query based on those

Hi , im trying to make tags in each document in firestore, so i can query based on the tags, do you know how i should structure the tags in firebase and how to filter the data when querying?

i want to do this

If you have any thoughts or have done it, please help…

A starting point could be this for example:

  • Product (Object)
    • (other product fields)
    • Tags (List of Objects)
      • id (String)
      • label (String)

Not sure about Firestore, whether Tags should be a separate Resource you refer to or not, but that’s also a possibility. Having the labels available under Product however makes the process of displaying product pages easier, so I would include the label with the id.

1 Like

Alright, i will try to find what’s best for querying
Thanks Mevi