Algolia query to return only the level 1 categories

I have a product index which has the category also. I want to know if there is any query in Algolia that would return only the level 1 categories (I have a category hierarchy that i need to show from Algolia).

Hello!

You should be able to achieve this, would you mind sharing a snippet of how your data is structured (anonymized if needed) and I can help you write a query for this? Thanks!