#community-help

Accessing string[] Data Type in Typesense Demos

TLDR Vishal inquired about accessing string[] datatype fields in Typesense demos. Jason suggested using console.log, but the issue remains unresolved.

Powered by Struct AI
Jun 12, 2023 (3 months ago)
Vishal
Photo of md5-178450ab9171fe1c7eba3a5eb7e1a312
Vishal
02:26 PM
For the various typesense demos (showcase xkcd, etc), if a datatype field in the schema is string[], does it now work? if so, how can we access it? (eg ${data.fieldname} doesn't work)
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
04:23 PM
If you console.log(data) you’ll see the variables inside the item
04:23
Jason
04:23 PM
(I would expect ${data.fieldname} to work on a side note as long as you haven’t excluded that field using exclude_fields or include_fields)
Vishal
Photo of md5-178450ab9171fe1c7eba3a5eb7e1a312
Vishal
04:23 PM
it works for string fields but not for string[]
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
04:24 PM
Hmm, could you try console.log?