removeAll (NotesViewEntryCollection - JavaScript)

Permanently removes the documents associated with the entries in a view entry collection from a database.

Defined in

NotesViewEntryCollection

Syntax

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

Usage

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

The current pointer is reset to the first entry.

Examples

This button removes all documents in a view that match a search query.
if (requestScope.query.isEmpty()) return;
if (!database.isFTIndexed()) database.createFTIndex(0, false);
var vec:NotesViewEntryCollection = database.getView("main").getAllEntries();
vec.FTSearch(requestScope.query);
if (vec.getCount() > 0) {
	vec.removeAll(true);
	requestScope.status =  "Document(s) removed";
} else {
	requestScope.status =  "No match";
}