createDocumentCollection (NotesDatabase - JavaScript)

Creates a document collection in a database and returns a NotesDocumentCollection object that represents the new collection.

Defined in

NotesDatabase

Syntax

createDocumentCollection() : NotesDocumentCollection
Return value Description
NotesDocumentCollection The new document collection.

Usage

You must call save if you want the new document to be saved.

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);
	}
	var tmpdoc = view.getNextDocument(doc);
	doc.recycle();
	doc = tmpdoc;
}
requestScope.status = "Number of documents removed: " + dc.getCount();
dc.removeAll(true);

Language cross-reference

CreateDocumentCollection method in LotusScript® NotesDatabase class

createDocumentCollection method in Java Database class