I'm trying to bulk delete documents based on a pattern but, since the collection contains 500K plus documents, the forloop seem to get hung. Below is my code:
for (const uri of cts.uris("", null, cts.jsonPropertyValueQuery("source", "survey"))) {
xdmp.documentDelete(uri);
}
Can somebody help me with a better way to delete documents in MarkLogic when there is large volume?