Prismic filters - error 500 when field not available in prismic

I am using the following filter when fetching data from prismic:

prismicC.filter.any(`my.alert.page_type.page`, [
      alertData.page,
]),

The filter is working as expected only when "my.alert.page_type.page" field is declared in prismic. How can I modify my filter to make it work (fetch the document) if the field is not defined as well?

I am looking for something simillar to:

const filters: string[] = [
  prismicC.filter.or([
    prismicC.filter.missing(`my.alert.page_type.page`),
    prismicC.filter.any(`my.alert.page_type.page`, [alertData.page]),
  ]),
];

(or filter does not exist in prismic)

The only solution that I can see right now is to do client side filtering...

Hi @gulfteam ,

Welcome to the community!

I'm not sure I fully understand your use case. If you want to query all pages that have the value or don't have the value, why not just query by the page type?

One thing, though, there is no or operator with the Prismic API.

Or you could query by any pages that don't have an array that you don't want?