DeleteMany returns non-readable IDs in verbose mode (TypeScript client v3.8.0)

Hi,

I’m using the TypeScript client v3.8.0 for Weaviate. According to the official documentation, when I use deleteMany with the { verbose: true } option, the response should include the UUIDs of the deleted objects as readable strings in the id field of each object in res.objects (e.g., "id": "208cf21f-f824-40f1-95cb-f923bc840ca6")Delete objects: Optional parameters.

However, in my case, the IDs returned are not readable UUID strings, but rather appear as binary or garbled data. Here is a sample of my code and the output:

const res = await collection.data.deleteMany(
  collection.filter.byProperty("brandId").equal(brandId),
  { verbose: true }
);

console.log("res DELETE", res);

const itemsUuids = res.objects.map(obj => obj.id);

And the output:

res DELETE {
  took: ...,
  failed: 0,
  matches: 20,
  successful: 20,
  objects: [
    { id: 's��Q��H��[�>�\x1D2�', successful: true, error: '' },
    ...
  ]
}

The items that have to be deleted are effectively deleted but I just dont get why the IDs are not readable strings.

The documentation does not mention this behavior, and I could not find any explanation for why the IDs are not returned as readable UUID strings.

  • Is this a known issue with the TypeScript client v3.8.0?

  • Is there a workaround or recommended way to get the readable UUIDs of the deleted objects?

Thank you!

hey @MELINA_BELEN_JAUREGU thanks for spotting this. Just confirmed this behaviour, could you open an issue on the repo so we can prioritise fixing it?

Hey @MELINA_BELEN_JAUREGU,

I’ve just replicated this locally and can confirm I’m seeing the same behavior.

import weaviate, { Filters } from 'weaviate-client';

async function main() {
  const client = await weaviate.connectToWeaviateCloud('<END_POINT>', {
    authCredentials: new weaviate.ApiKey('<KEY>'),
    headers: { 'X-OpenAI-Api-Key': '<KEY>' },
    timeout: { init: 30, query: 300, insert: 300 },
    skipInitChecks: true,
  });

  async function deleteByDirector(director: string, status: string) {
    const collection = client.collections.get('Momo');

    const filters = Filters.and(
      collection.filter.byProperty('director').equal(director),
      collection.filter.byProperty('status').equal(status)
    );

    try {
      const res = await collection.data.deleteMany(filters, { verbose: true });
      console.log("Delete result:", res);

      const itemsUuids = res.objects?.map(obj => obj.id) || [];
      console.log("Deleted item UUIDs:", itemsUuids);

      return res;
    } catch (error) {
      console.error('Error during delete operation:', error);
      throw error;
    }
  }

  await deleteByDirector("Baz Luhrmann", "Released");
}

main().catch(console.error);

Thank you, Daniel @malgamves - I have reported the bug below:

Best regards,

Mohamed Shahin
Weaviate Support Engineer
(Ireland, UTC±00:00/+01:00)

Thank you all!! Works fine now :slight_smile:

1 Like