09-05-2014 04:12 AM
var query = "@cm\\:name:\"~*\"";
var nodes = search.luceneSearch(query);
var c = 0;
var d = 0;
var f = 0;
logger.log("Found " + nodes.length + " temporary files");
for (var node in nodes) {
try {
var doc = search.findNode("workspace://SpacesStore/" + nodes[node].properties["sys:node-uuid"]);
var location = doc.displayPath + "/" + doc.name;
if (doc.isContainer) {
f++;
continue;
}
if(doc.remove())
logger.log(location + " - deleted");
d++;
} else {
logger.log(location + " - not deleted");
}
} catch (e) {
logger.log(e);
}
c++;
if (c > 0) {
break; //comment to delete ALL nodes from search result
}
}
logger.log(d + "/" + c + " documents deleted");
logger.log(f + "/" + c + " were folders");
doc.remove()
are returning true
which means "success" at the documentation. No errors or exceptions, also nothing will get deleted
09-05-2014 05:41 AM
09-05-2014 06:07 AM
09-05-2014 06:25 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.