Issue with Excluding Specific Tags in Document Queries

Our goal is to fetch documents of type "team" but exclude those tagged with "BOD" (Board of Directors) and "CM" (Company Management). We've attempted to use the prismic.filter.not method in our query, expecting it to filter out documents with these tags. However, the query still returns documents tagged with "BOD" and "CM".

const queryTeam = (lang: string) => {
  return client.get({
    filters: [
      prismic.filter.at("document.type", "team"),
      prismic.filter.not("document.tags", ["BOD", "CM"]),
    ],
    lang,
  });
};

I also tried to change the filters order, still the same issue

Hi @savco ,

Welcome to the community :slight_smile:

I can confirm that methods for tags arrays aren't working on your repo. I'm reporting this as a bug to the dev team.

In the meantime, the best thing to do here is filter the results on your application side.

Sorry for the inconvenience caused by this.

but what if I'm using pagination ? filtering on client might not be a good approach, right ? because we may get fewer results compared to other pages , which can be a concern.
is this going to be fixed any time soon by any chance ?

If you're using one of our kits you can do a getAllByType query and not have to worry about API pagination.

I don't have an ETA on when this will be fixed, I'm still waiting on a response from the dev team.

this issue still exist, its been 2 weeks, any updates ?

Hey @savco ,

I think there was some confusion last time we talked; my apologies. It seems it is working.

When I query your type "team", I get 6 documents, 3 with the tag BOD and 3 with the tag CM:
https://savco.prismic.io/api/v2/documents/search?ref=Zbop7xAAACMAvogA&q=[[at(document.type%2C+"team")]]&src=apibrowser#format=json

If I query by the tag "BOD", I get those 3 docs:
https://savco.prismic.io/api/v2/documents/search?ref=Zbop7xAAACMAvogA&q=[[at(document.tags%2C+["BOD"])]]&src=apibrowser#format=json

The same goes for "CM"
https://savco.prismic.io/api/v2/documents/search?ref=Zbop7xAAACMAvogA&q=[[at(document.tags%2C+["CM"])]]&src=apibrowser#format=json

If I query which documents don't have both tags I get 25 docs:
https://savco.prismic.io/api/v2/documents/search?ref=Zbop7xAAACMAvogA&q=[[not(document.tags%2C+["BOD"%2C"CM"])]]&src=apibrowser#format=html

If I query which document DO have BOTH tags, I get 0 docs:
https://savco.prismic.io/api/v2/documents/search?ref=Zbop7xAAACMAvogA&q=[[at(document.tags%2C+["BOD"%2C"CM"])]]&src=apibrowser#format=html

So the method is working as expected on your repo.