WhereFilter Not Working In Deleting Records

I am trying to delete a Weaviate object using WhereFilter in Java, but it is not deleting the object.

Below is the code for deleting the object:

client.batch().objectsBatchDeleter()
    .withClassName(objectClass)
    .withWhere(WhereFilter.builder()
        .path("_metadata", "id")
        .operator(Operator.Equal)
        .valueString("1")
        .build())
    .run();

The following screenshot shows the Weaviate object that I am trying to delete:

Any assistance would be greatly appreciated.

Hello, you want to delete from your objectClass class an object with id that equals 1?

Hello,
Yes I want to delete object which has id =1 in _metadata.

and what is the name of your class?

Test53f3c87a4585ae838abcefcc4e5b

You can see complete code in following pull request.

a proper syntax for reaching into reference properties is:

.path("<CROSS_REFERENCE_NAME>", "<REF_CLASS_NAME>", "<PROPERTY_OF_REF_CLASS>")

so in your case in should be something like that:

.path("_metadata", "<REF_CLASS_NAME>", "id")

Hi @antas-marcin ,

Thank you for the answer, but it is not working.

I have created a free weaviate cloud cluster and here is what I see:


It seems that metadata field (and its subfields) should be filterable for the test to work. Could you please tell me how to enable it using code. I couldn’t find any documentation on it

hi @kiratkumar47 !!

There are only some configurations in a collection that are mutable.

This is not one of them :see_no_evil:

So on that case, you can create a new collection with the proper configuration, and insert or migrate your data over.

Let me know if this helps!
Thanks!