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!

Hello,
Apologies for the delayed response.
Here is a structure which is similar to that of my data:

{
“objectID”:“abc-1234”,
“skuId”:“abc-1234”,
“skuTitle”: “Solo Backpack Black”,
“inventory”:5,
“price”:10,
“availStartDate”: null,
“onSale”:“false”,
“name”: “3DR - Backpack for Solo - Black”,
“hierarchicalCategories”: {
“lvl0”: “Toys, Games & Drones”,
“lvl1”: “Toys, Games & Drones > Drones & Accessories”,
“lvl2”: “Toys, Games & Drones > Drones & Accessories > Drone Accessories”,
“lvl3”: “Toys, Games & Drones > Drones & Accessories > Drone Accessories > Drone Bags & Cases”
},
“type”: “Drone accessory”,
“price”: 149.95
}

I need to get only the level 0 categories first, then when the user hovers/clicks on a particular level 0 category, i need to show the corresponding level 1 categories.

Apologies for the delayed response. My data is structured in a similar manner as shown below:
“name”:“Product1”,
“objectID”: “sku-1234”,
“description”: “Product description”,
“hierarchicalCategories”: { “lvl0”: “Electronics”, “lvl1”: “Electronics > phones”,
“lvl2”: "Electronics > phones > Smartphones "
}