#community-help

Filtering Restaurant Data Based on Opening Hours

TLDR houssemro wanted a solution to filter restaurant data based on opening hours. Jason suggested flattening the records.

Powered by Struct AI
2
20mo
Solved
Join the chat
Jan 12, 2022 (20 months ago)
houssemro
Photo of md5-5a7e6fd9a070eac5034a6034f0dc38b1
houssemro
02:41 PM
Hi everyone, in my restaurents data i have a dictionnary field called openning_hours ,for example
"openning_hours":{"monday":[09:00:22:00],Thursday:[09:00:22:00],..}
i want to filter my data in the filter_by field to only return the open restaurents
can anyone tell me what is the most convenient solution ?
thank you.
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
02:43 PM
You need to flatten the records like this to filter by it: https://typesense.org/docs/guide/migrating-from-algolia.html#indexing-nested-fields