I need to delete a whole collection of documents in Raven DB. Deleting one by one (documents) is not a wise choice. Is there a way I can do this easily?
You can do a set based operation.
store.DatabaseCommands.DeleteByIndex() to do so
store.DatabaseCommands.DeleteByIndex(
"Enquiries/MyEnquiryIndexName",
new IndexQuery { Query = "Id:*", },
allowStale: false);
Code sample by @Marijin
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With