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.
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:
opened 09:49AM - 21 Aug 25 UTC
**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:**
```typescript
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.
```javascript
{
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.
```javascript
{
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);
```
Best regards,
Mohamed Shahin
Weaviate Support Engineer
(Ireland, UTC±00:00/+01:00)
Thank you all!! Works fine now
1 Like