Quantcast
Channel: Weaviate Community Forum - Latest posts
Viewing all articles
Browse latest Browse all 3605

Delete object with id array failed

$
0
0

Hi @sebawita ,

Thank you so much for help me debug the issues.

My project environment: node.js (version 22.0.0) typescript (version 5.3.3)

1 After run this command:console.log((await client.getMeta()).version),
I got this output: 1.26.0-rc.0

2 weaviate-client 3.1.4

Below is the script you provided and output:

  const result = await myCollection.aggregate.overAll();
  const totalCount = result.totalCount;
  console.log('totalCount',totalCount);
  const res = await myCollection.query.fetchObjects({ limit: 3 });

  const itemsIdToDelete = res.objects.map((o) => o.uuid);
  console.log(
    `UUIDs to delete:\n${JSON.stringify(itemsIdToDelete, null, 2)}`
  );

  const testdeleteResult = await myCollection.data.deleteMany(
    myCollection.filter.byId().containsAny(itemsIdToDelete),
    {
      dryRun: true,
    }
  );

  console.log("testdeleteResult",JSON.stringify(testdeleteResult, null, 2));

Output:

INFO totalCount 40
2024-12-17T13:56:47.332Z bc863d5c-78ed-426c-8b25-7e68b2d28e4a INFO UUIDs to delete:
[
“016d2780-44d3-409b-8047-d4bddd706705”,
“0fe66df1-a04e-439c-bcf8-addeabdaef4c”,
“1006e63e-d1db-402d-9e49-5150eac5339b”
]
2024-12-17T13:56:47.354Z bc863d5c-78ed-426c-8b25-7e68b2d28e4a INFO testdeleteResult {
“took”: 0.0007071029976941645,
“failed”: 0,
“matches”: 0,
“successful”: 0
}


Viewing all articles
Browse latest Browse all 3605

Trending Articles