Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MarkLogic - Quickest Way to Empty a Large Database

What is the quickest way to empty a large database of documents in MarkLogic version 5?

like image 928
Ben Aston Avatar asked Apr 16 '26 03:04

Ben Aston


1 Answers

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")))

like image 94
DALDEI Avatar answered Apr 17 '26 21:04

DALDEI



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!