contains (NotesDocumentCollection - JavaScript)

指定された文書が文書コレクションに含まれるかどうかを示します。

定義場所

NotesDocumentCollection

構文

contains(noteid:string) : boolean

contains(noteid:int) : boolean

contains(documents:NotesBase) : boolean

パラメータ 説明
noteid 文書の文書 ID。
documents 種類が NotesDocumentNotesDocumentCollectionNotesViewEntryNotesViewEntryCollection のオブジェクトです。ビューエントリは文書を指す必要があります。
戻り値 説明
boolean 指定された文書がこの文書コレクションに含まれる場合は true、含まれない場合は false を返します。

使用法

このメソッドで包含関係が判別される文書は、元のコレクションと同じデータベース内になければなりません。それ以外の場合、このメソッドは「指定された文書がデータベースにありません」というエラーを返します。文書 ID が元のコレクションのデータベース内の文書 ID に一致するメソッドに渡された場合、メソッドは意図されない文書を使用します。

パラメータが空のコレクションの場合、このメソッドは true を返します。

以下のボタンは、現在の文書が検索結果によって作成されたコレクション内に含まれるかどうかを判別します。
try {

var noteid:string = currentDocument.getDocument().getNoteID();
var dc:NotesDocumentCollection = database.getAllDocuments();
var query:string = requestScope.query;
if (!query.isEmpty()) {
	query = "¥"" + query + "¥"";
	database.updateFTIndex(true);
	dc.FTSearch(query);
	if (dc.contains(noteid)) {
		requestScope.status = "Current document contains query";
	} else {
		requestScope.status = "Current document does not contain query";
	}
} else {
	requestScope.status = "No query";
}

} catch(e) {
	requestScope.status = e.message;
}

言語間の参照

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

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