I want to list all data from /products collection. But I also want to get data from /products collection filtered by tags.
So the case is: get all products that have tags red, greed and blue. Tags are also searchable in app by specific language but ID should be the same that is why I am referencing IDs from products.
My design idea:
/tags
-tag_id_1: {en: "red", de: "rot"}
-tag_id_2: {en: "green", de: "grün"}
-tag_id_3: {en: "blue", de: "blau"}
/products
-PRODUCT_1
-title: ""
-description: ""
-date: ""
-tags: [tag_id_1,tag_id_2,tag_id_3]
-PRODUCT_2
-title: ""
-description: ""
-date: ""
-tags: [tag_id_3]
Now to the problem:
- Should I duplicate selected tags translations in each product and have
tagIds:[]andtags: {{tag},{tag}...} - With this structure is it possible to fetch all products that has
tag_id_1,tag_id_2,tag_id_3ordered bydate?