Query documents by slice data

I have a blog post that has slice that could have multiple relations with another type. So basically I have a blog post that can have multiple categories. I need to filter all posts that contains a categoryid. The category id is on teh vody of the result data. I didn’t find any docs that stays how to query by slice data. Is this even possible? If it’s not, what would be the best way to model the data in order to have a post with multiple categories and be able to search a post by any of the categories ?


Hi @levijesica, unfortunately it isn’t possible to query by a field inside of a Slice. In order to do what you want to do, you can use a Content Relationship field inside of a Group field. This you can query by and will allow you to select multiple categories for each post.