コレクション内の文書をデータベースから完全に削除します。
パラメータ | 説明 |
---|---|
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);
この操作によってデータベースから削除されるすべての文書は、コレクションからも削除されます。