In most programming languages, dot notation is used to access properties or methods of an object. However, dot notation is not used to access elements of an array in an Algolia record.
Instead, elements of an array are accessed using square bracket notation with an index value.
In the following example record structure, “variants” is an array:
{
"objectID": "1",
"product": "T-Shirt",
"variants": [
{
"size": "Small",
"color": "Red"
},
{
"size": "Large",
"color": "Blue"
}
]
}
If you'd like to retrieve “size: Small”, you can only access its elements using an index number enclosed in square brackets - “variants[0].size”. We do not support dot notation on arrays at this time.
This article goes into further detail.