removeAll (NotesDocumentCollection - JavaScript)

コレクション内の文書をデータベースから完全に削除します。

定義場所

NotesDocumentCollection

構文

removeAll(force:boolean) : void
パラメータ 説明
force true を指定すると、文書が取り出された後に別のユーザーがその文書を変更している場合でもその文書は削除されます。false を指定すると、別のユーザーが先にその文書を変更している場合は、文書は削除されません。

以下のボタンは、文書コレクションを作成し、文書を条件に応じて追加した後、これらの文書を削除します。
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);

使用法

このメソッドは、現在のポインタをコレクションの最初の文書に移動します。

この操作によってデータベースから削除されるすべての文書は、コレクションからも削除されます。

言語間の参照

LotusScript® NotesDocumentCollection クラスの RemoveAll メソッド

Java™ DocumentCollection クラスの removeAll メソッド