I try to fetch stories and apply filters on them. However I end up on a problem. According to the result data I get, I believe that filter_query params are connected with OR operator. My query looks something like this:
const storyblokApi = useStoryblokApi()
const { data: realty, pending } = await useAsyncData<Realty>(
async () => await storyblokApi.get(cdn/stories, {
version: "published",
content_type: "project",
per_page: 6,
filter_query: {
price: {
"gt-int": 0,
"lt-int": 1300001,
},
area: { in_array: "Dubai Marina,Blue Waters" },
market: { in_array: "primary" },
}
})
)
The result is stories (projects) who have area of Dubai Marina and Blue Waters however "Blue Waters" has market:"secondary" and should not be. I expect to have only projects of Dubai Marina who have market:"primary", and projects of area:"Blue Waters" not to be added.
I also noticed that if i change the order of the filter params I get different results
As far as I know there's no operator
in_arrayso it will be ignored. According to the docs there are two operators for arrays calledany_in_arrayandall_in_array.https://www.storyblok.com/docs/api/content-delivery/v2#filter-queries/operation-any-in-array