Skip to content

deleteMany with verbose: true Returns Corrupted/Garbled UUID Strings #332

@Shah91n

Description

@Shah91n

Description:
When using the deleteMany method with the { verbose: true } option in the Weaviate TypeScript client (v3.8.0), the response does not contain the UUIDs of the deleted objects as human-readable strings. Instead, the id field for each object in the response contains garbled, binary-like data.

This behavior is wrong, which indicates that readable UUID strings should be returned.

Steps to Reproduce:

  1. Connect to a Weaviate instance using the TypeScript client.
  2. Execute a deleteMany operation with a filter and the { verbose: true } option.
  3. Log the response or attempt to map the returned id values.

Code Example:

const collection = client.collections.get('YourCollection');
const res = await collection.data.deleteMany(
  collection.filter.byProperty("brandId").equal("someBrandId"),
  { verbose: true } // Expecting readable UUIDs in the response
);

console.log("Delete Result:", res);
// The `res.objects[].id` fields are garbled, not readable UUIDs.

Actual Result:
The response object contains successful deletion confirmation, but the id fields are unreadable.

{
  took: 10,
  failed: 0,
  matches: 20,
  successful: 20,
  objects: [
    { id: 's��Q��H��[�>�\x1D2�', successful: true, error: '' }, // Garbled ID
    // ... more objects with similarly corrupted IDs
  ]
}

Expected Result:
The response should contain standard, readable UUID strings in the id field for each successfully deleted object, as per the documentation.

{
  took: 10,
  failed: 0,
  matches: 20,
  successful: 20,
  objects: [
    { id: '208cf21f-f824-40f1-95cb-f923bc840ca6', successful: true, error: '' }, // Readable UUID
    // ... more objects with readable UUIDs
  ]
}

Environment:

  • Weaviate TypeScript Client Version: 3.8.0
  • Weaviate Server: 1.32.4

Full Example

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions