What is the quickest way to empty a large database of documents in MarkLogic version 5?
The absolutely fastest way to empty a database is to clear all the forests connected to it. go to the Database in the admin GUI and find each forest. Then go to each forest and select Clear it will instantly delete all documents in the database.
If you want to do this programatically there is this
or
xdmp:forest-clear(xdmp:database-forests(xdmp:database("My Database")))
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