# \[Docs\] How to make a Not in filter instead of ContainsAny operator?

**URL:** <https://forum.weaviate.io/t/docs-how-to-make-a-not-in-filter-instead-of-containsany-operator/2730>\
**Category:** Support\
**Tags:** documentation\
**Created:** [June 17, 2024, 9:41pm UTC](https://forum.weaviate.io/t/docs-how-to-make-a-not-in-filter-instead-of-containsany-operator/2730 "2024-06-17T21:41:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matheus\_Carneiro](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/matheus_carneiro/32/641_2.png) [@Matheus\_Carneiro](https://forum.weaviate.io/u/Matheus_Carneiro)\
**Post date:** [June 17, 2024, 9:41pm UTC](https://forum.weaviate.io/t/docs-how-to-make-a-not-in-filter-instead-of-containsany-operator/2730/1 "2024-06-17T21:41:03Z")

</div>

I’m trying to delete all elements that do not have a property, any ideas of doing that?

---

<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 19, 2024, 1:20pm UTC](https://forum.weaviate.io/t/docs-how-to-make-a-not-in-filter-instead-of-containsany-operator/2730/2 "2024-06-19T13:20:14Z")

</div>

hi @Matheus_Carneiro !!

Welcome back 🙂

First your class need to have the [IndexNullState](https://weaviate.io/developers/weaviate/config-refs/schema#invertedindexconfig--indexnullstate) set.

**Note** : This is [not a mutable configuration](https://weaviate.io/developers/weaviate/config-refs/schema#mutability).

With that on, you filter by null state.

here a code sample:

```auto
from weaviate.classes.config import Configure
from weaviate.classes.query import Filter

client.collections.delete("Collection")

collection = client.collections.create(
    name="Collection",
    vectorizer_config=Configure.Vectorizer.none(),
    inverted_index_config=Configure.inverted_index(
        index_null_state=True
    )
)

# we add some data
collection.data.insert({"text": "Some text 1", "notext": "Hello"})
collection.data.insert({"text": "Some text 2"})
collection.data.insert({"text": "Some text 3"})

# now fetch only where notext is empty
result = collection.query.fetch_objects(
    filters=Filter.by_property("notext").is_none(True)
)

for object in result.objects:
    print(object.properties)

# now we delete
collection.data.delete_many(
    where=Filter.by_property("notext").is_none(True)
)

# checking the deletion
from weaviate.classes.query import Filter
result = collection.query.fetch_objects()

for object in result.objects:
    print(object.properties)

# output: {'text': 'Some text 1', 'notext': 'Hello'}

```

Let me know if this helps 🙂

Thanks!
