Unable to use batch delete by id

I am trying to use below code.

client.batch.delete_objects(
        class_name=class_name,
        where={
            'path': ['id'],
            'operator': 'ContainsAny',
            'valueTextArray': uuids
        },
    )

And it throws this error:

UnexpectedStatusCodeException: Delete in batch! Unexpected status code: 422, with response body: {‘code’: 606, ‘message’: ‘operator in body should be one of [And Or Equal Like Not NotEqual GreaterThan GreaterThanEqual LessThan LessThanEqual WithinGeoRange IsNull]’}.

This is the reference:

And I am using weaviate image: semitechnologies/weaviate:1.17.5 & 1.18.0

Weaviate client version: 3.25.3

Can you please help me?

Hi,

The ContainsAny and ContainsAll operators were added in Weaviate 1.21:

In order to use them, you would need to upgrade your weaviate versions.
Since it looks like you are matching the whole id, you could use the ‘Or’ operator and multiple ‘Equal’ or ‘Like’ operands to achieve the same result on older weaviate versions (see Filters | Weaviate - vector database )

Hope this helps!

2 Likes