#community-help

Deleting All Documents with Filter_by

TLDR Mischa wants to delete all documents using id:* filter but encounters issues. Jason suggests a workaround and advises creating a GitHub issue for the desired feature.

Powered by Struct AI
May 16, 2023 (7 months ago)
Mischa
Photo of md5-5faa26225a23ba2f1f83f2258d39478c
Mischa
12:49 AM
Since there is no "delete all documents" function I am trying to use a filter_by id:*

But it seems to leave some records. Any idea why?
Image 1 for Since there is no "delete all documents" function I am trying to use a filter_by `id:*`

But it seems to leave some records. Any idea why?Image 2 for Since there is no "delete all documents" function I am trying to use a filter_by `id:*`

But it seems to leave some records. Any idea why?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
12:58 AM
Hmm! I’m surprised id:* actually matches any documents, since wild-cards are not supported like that…
12:59
Jason
12:59 AM
If you have a numeric field, one thing you could do is delete by numeric_field>:0 assuming there are no negative values
Mischa
Photo of md5-5faa26225a23ba2f1f83f2258d39478c
Mischa
01:01 AM
i would really like a generic thing since i want to be able to just wipe all my collections, modify schemas, then reindex everything
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
01:04 AM
We unfortunately don’t have a generic way to “truncate” a collection at this time. Could you create a GitHub issue for it, so we can track it?