removeAll (NotesDocumentCollection - JavaScript)

Permanently removes the documents in a collection from a database.

Defined in

NotesDocumentCollection

Syntax

removeAll(force:boolean) : void
Parameter Description
force If true, a document is removed even if another user modifies the document after it is retrieved. If false, a document is not removed if another user modifies it first.

Examples

The following button creates a document collection, adds documents conditionally, then removes those documents.
var dc:NotesDocumentCollection = database.createDocumentCollection();
var view:NotesView = database.getView("main");
var doc:NotesDocument = view.getFirstDocument();
while (doc != null) {
	if (doc.getItemValueString("subject").endsWithIgnoreCase("obsolete")) {
		dc.addDocument(doc);
	}
	doc = view.getNextDocument(doc);
}
requestScope.status = "Number of documents removed: " + dc.getCount();
dc.removeAll(true);

Usage

This method moves the current pointer to the first document in the collection.

All documents removed from the database as a result of this operation are also removed from the collection.