This message was deleted.
# community-help
s
This message was deleted.
j
You want to use
object[]
j
how do we set the type of the array inside it?
j
Could you give me an example JSON document?
j
Copy code
[
  {
    "name": "simple",
    "nameAndType": "simple|product_type",
    "slug": "simple",
    "type": "product_type",
    "url": "https://google.com/?product_type=simple"
  },
  {
    "name": "featured",
    "nameAndType": "featured|product_visibility",
    "slug": "featured",
    "type": "product_visibility",
    "url": "https://google.com/?product_visibility=featured"
  },
  {
    "name": "Father's Day Gift Hampers",
    "nameAndType": "Father's Day Gift Hampers|product_cat",
    "slug": "fathers-day-gift-hampers",
    "type": "product_cat",
    "url": "https://google.com/product-category/fathers-day-gift-hampers/"
  }
]
this is the sample data @Jason Bosco
j
If you just set
object[]
for the top level type, Typesense will infer the rest of the structure inside the nested array of objects
But if you want to for eg, only index nestedField.slug, you can define it like this:
Copy code
{name: 'nestedField.slug', type: 'string[]', optional: true}
j
ah make sense now.
thank you
👍 1