Correct Formatting for Execute Batch Delete Commands
TLDR Nikunj encountered an error while executing a multiple delete command. Kishore Nallan helped correct the syntax and directed to relevant documentation.
Feb 01, 2023 (8 months ago)
Nikunj
09:09 AMdoing multiple delete like this but getting this give error
code
await client.collections(collectionName).documents().delete({ 'filter_by=id': ids })
error
Request failed with HTTP code 400 | Server said: Parameter `filter_by` must be provided.
Kishore Nallan
09:10 AMNikunj
09:18 AMfilter_by=id: [id1, id2, id3]
it is showing a similar syntax
Kishore Nallan
10:03 AMawait client.collections(collectionName).documents().delete({ 'filter_by': 'id: [id1, id2]' })
Kishore Nallan
10:05 AMTypesense
Indexed 2779 threads (79% resolved)
Similar Threads
Typesense Cloud Issue: Unable to Delete Documents by ID
Ellen had trouble using Typesense Cloud's `filter_by` option to delete documents by id. Jason solved this by suggesting to remove double-quotes around IDs in `filter_by` clause.
Batch Deletion Error in Typesense Using Array of IDs
sonu was confused about batch deleting with an array of ids. Kishore Nallan clarified that they'd need to explicitly add ids as a field because they're not indexed. Future improvements planned.
Resolving Document Export & Batch Deletion Issues
Dui had trouble exporting a document and wanted batch deletion assistance. Kishore Nallan fixed the export issue, upgraded their cluster manually and suggested using `delete by query`.