# Has ContainsNone Operator been added

**URL:** <https://forum.weaviate.io/t/has-containsnone-operator-been-added/21508>\
**Category:** Support\
**Created:** [June 25, 2025, 4:21am UTC](https://forum.weaviate.io/t/has-containsnone-operator-been-added/21508 "2025-06-25T04:21:29Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![SomebodySysop](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/somebodysysop/32/70_2.png) [@SomebodySysop](https://forum.weaviate.io/u/SomebodySysop)\
**Post date:** [June 25, 2025, 4:21am UTC](https://forum.weaviate.io/t/has-containsnone-operator-been-added/21508/1 "2025-06-25T04:21:29Z")

</div>

### Description

I saw this post on GitHub: [Implements `ContainsNone` Operator by avirlrma · Pull Request #4576 · weaviate/weaviate · GitHub](https://github.com/weaviate/weaviate/pull/4576)

Which seems to suggest that the ContainsNone operator has been added, but I don’t find any documentation for it. Can you please clarify?

If it has not been added, is there a way to create a filter for an object property array to make sure that the results do NOT contain specific elements in the array?

### Server Setup Information

I am running on WCS.

### Any additional Information

For example, I have a text field which contains an array of the names of groups to which the object belongs.

What I want to do is to be able to add an exclusion filter.

I want to be able to say that if the object contains: Labor Private Group, Apple Private Group, Amazon Private Group or Netflix Private Group, it should NOT be returned.

---

<div class="post-metadata">

**Author:** ![SomebodySysop](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/somebodysysop/32/70_2.png) [@SomebodySysop](https://forum.weaviate.io/u/SomebodySysop)\
**Post date:** [June 25, 2025, 6:45pm UTC](https://forum.weaviate.io/t/has-containsnone-operator-been-added/21508/2 "2025-06-25T18:45:20Z")

</div>

JP responded to this here: [Slack](https://weaviate.slack.com/archives/C02RRQP23K3/p1750853280033099?thread_ts=1750825498.547069&cid=C02RRQP23K3)

_the PR was closed without being merged_

This is my response:

How can I press for this (or something similar) as a filter operator? This would allow a level of access control within the filter that currently doesn’t exist. Essentially, it would allow for an “exclusion filter” to allow you to exclude objects that a user can not access. The only way to do this through application-level code would be to parse the query results **after the fact**. This is far less efficient.

Do you see what I am saying? The exclusion filter returns a smaller, pre-filtered result set, reducing the number of documents that need to be processed. This is far **more** efficient.

Who do I need to talk to to make this case?

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [June 25, 2025, 8:48pm UTC](https://forum.weaviate.io/t/has-containsnone-operator-been-added/21508/3 "2025-06-25T20:48:26Z")

</div>

hi @SomebodySysop !!

Thanks for updating it here.

We’ll poke and push this internally so it can be released as this is indeed a popular feature request!

---

<div class="post-metadata">

**Author:** ![SomebodySysop](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/somebodysysop/32/70_2.png) [@SomebodySysop](https://forum.weaviate.io/u/SomebodySysop)\
**Post date:** [June 25, 2025, 8:53pm UTC](https://forum.weaviate.io/t/has-containsnone-operator-been-added/21508/4 "2025-06-25T20:53:24Z")

</div>

Thank you! For anyone trying to implement any permissions-based access control to vectorized content (using the object properties), this would be a MUST HAVE feature.

---

<div class="post-metadata">

**Author:** ![SomebodySysop](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/somebodysysop/32/70_2.png) [@SomebodySysop](https://forum.weaviate.io/u/SomebodySysop)\
**Post date:** [July 9, 2025, 5:07pm UTC](https://forum.weaviate.io/t/has-containsnone-operator-been-added/21508/5 "2025-07-09T17:07:55Z")

</div>

Hi @Marion_Nehring and @sebawita for a great Hero Roundtable yesterday. If I seemed a bit more animated than usual, it is because I have a major deal pending whose success is riding on a certain capability I need in Weaviate being available.

It was requested here two years ago: [FR: Add a `ContainsNone` operator · Issue #3513 · weaviate/weaviate · GitHub](https://github.com/weaviate/weaviate/issues/3513)

I have discussed it previously in these threads:

- [Slack](https://weaviate.slack.com/archives/C02RRQP23K3/p1750825498547069)
- [Has ContainsNone Operator been added](https://forum.weaviate.io/t/has-containsnone-operator-been-added/21508)

I need implementation of the “ContainsNone” GraphQL operator. This will allow me to create, using my existing query properties, what I call an “Exclusion Filter”.

Why is this so important? Because it allows every Weaviate developer to implement access control over their vector stores using ONLY the GraphQL filter. I can give you the details of my particular use case in private, but in general:

Let’s say you use a class property called “Groups” to determine who can access particular pieces of content.

Public users can access Groups A, B and C. A Private organization creates content in Groups D and E that is restricted to it’s users.

A, B and C are also serve as categories, so it is possible for a single piece of content to belong to both A and D. In this very basic permissions scenario, the current GraphQL tool does not provide a way to EXCLUDE content from Public users that belongs to both Public and Private groups.

That’s where the “Exclusion Filter” comes in.

**Purpose** : Improves search performance by filtering out group-restricted content at the query level.

**How it works** :

1. **Receives** query prompt with identified user from calling app
2. **Checks** which groups the current user cannot view (lacks “view group” permission in calling app)
3. **Builds** a filter query to exclude documents containing those groups in the Groups property
4. **Adds** the filter as a ContainsNone operator: field:“GroupD” OR field:“GroupE”) to the GraphQL

**Result** : GraphQL returns a smaller, pre-filtered result set, reducing the number of documents that need potentially expensive permission checking.

**Key benefits** :

- **Performance** : Less data transferred from Weaviate (economical and faster)
- **Efficiency** : Bulk filtering at database level vs individual applications level checks
- **Non-intrusive** : Doesn’t change search relevance or user’s search terms
- **Safe** : Restricted Documents which also belong to public groups are NOT included by default

So, what can I do to get this in front of developers to make the case that this would not only help me out, but could be of great benefit to many other users seeking to control access using just the GraphQL tool?

---

<div class="post-metadata">

**Author:** ![SomebodySysop](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/somebodysysop/32/70_2.png) [@SomebodySysop](https://forum.weaviate.io/u/SomebodySysop)\
**Post date:** [July 26, 2025, 3:28pm UTC](https://forum.weaviate.io/t/has-containsnone-operator-been-added/21508/6 "2025-07-26T15:28:18Z")

</div>

I tried working with Claude 4 on this. No luck. This was it’s conclusion:

Perfect! So those documents do exist. This confirms the limitation: **Weaviate doesn’t have a way to exclude documents based on array contents** with the current operator set.

The available operators for arrays are:

- `ContainsAny` - **includes** documents where the array contains any of the specified values
- `ContainsAll` - **includes** documents where the array contains all of the specified values

But there’s no:

- `NotContainsAny` - to **exclude** documents where the array contains any of the specified values
- `NotContainsAll` - to **exclude** documents where the array contains all of the specified values

This is a gap in Weaviate’s query capabilities for array fields.

**Your options are:**

1. **Remove the exclusion filter from the Weaviate query** and handle the filtering in your application code after getting the results
2. **Contact Weaviate team** to request `NotContainsAny`/`NotContainsAll` operators
3. **Restructure your data model** (if possible) to make exclusions easier to query

For now, I’d recommend going with option 1 - get the results from your working query (without the exclusion) and then filter out documents containing “Labor Private Group” or “Sysop Private Group” in your application logic.

This is unfortunately a limitation of Weaviate’s current query language, not something we can solve with different query syntax.

Help!

---

<div class="post-metadata">

**Author:** ![SomebodySysop](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/somebodysysop/32/70_2.png) [@SomebodySysop](https://forum.weaviate.io/u/SomebodySysop)\
**Post date:** [September 4, 2025, 5:55pm UTC](https://forum.weaviate.io/t/has-containsnone-operator-been-added/21508/7 "2025-09-04T17:55:29Z")

</div>

ContainsNone filter operator finally added:

 ![contains none](https://canada1.discourse-cdn.com/flex027/uploads/weaviate/original/2X/c/ce1223049d81340ec9934f9181b5eb263d42acf6.png)

> <https://github.com/weaviate/weaviate/issues/3513#issuecomment-3188358722>
>
> Building on the work of #2387 and #3319 we can now support a \`ContainsNone\` arra…y operator.

Thank you @sebawita !!
