Hey community - does anyone have any experience or...
# community-help
j
Hey community - does anyone have any experience or advice for working with dictionary-esque structures as facets? I have this case where I would like to filter on sizes (the values) based on an store id (the key):
[
{
"id": 1,
"name": "t-shirt",
"instockinstores" :  [
{ "123" : [36,37,38,39] },
{ "456" : [38,39,40,41] }
]
}
]
The problem is that I don't know the store ids beforehand. Is it possible to do something like this?
f
1. You could use JOINs for that (many to many relationships between stores / products) https://typesense.org/docs/27.1/api/joins.html#one-to-one-relation 2. If you do want to go with the nested objects, you'd have to have an
id
key and
sizes
key like
Copy code
instockinstores: {
 id: string;
 sizes: number[]
}
Keep in mind this is typescript syntax. For Typesense syntax you'd have to have instockinstores be an
object[]
and then id and sizes be nested under it
🙏 1