NotesDocumentCollection (JavaScript)

Represents a collection of documents from a database.

Access

A document collection represents a subset of all the documents in a database. The documents in the subset are determined by the method or property you use to search the database, for example:

Usage

NotesDocumentCollection, NotesViewEntryCollection, and NotesViewNavigator objects provide access to documents in a database. Use a NotesDocumentCollection object if:
  • You want to act on a specific set of documents that meet certain criteria.
  • There is no view in the database that contains every document you need to search.
  • You do not need to navigate the documents' response hierarchies.

Views are a more efficient means of accessing documents because they are already indexed by the database itself. However, they do not necessarily provide access to the documents that you want. NotesViewEntryCollection and NotesViewNavigator objects provide access to view entries, which contain NotesViewEntry as well as NotesDocument information. NotesViewNavigator provides access to categories and totals as well as documents.

Sorted collections

The documents in a collection are not sorted unless the collection results from a search. By contrast, documents accessed through NotesViewEntryCollection and NotesViewNavigator are in view order.

Current® pointer

A current pointer is maintained for document collections. All navigation methods set the current pointer to the retrieved document with the following exceptions: add and delete methods do not move the current pointer. The following methods set the current pointer to the first document: FTSearch, removeAll (remote IIOP only), putAllInFolder, removeAllFromFolder, and stampAll.

Deletion stubs

A deletion stub is returned for a document deleted after creation of the collection or for a document to which you do not have Reader access. Use isValid in NotesDocument to check whether a document is real (true) or a deletion stub (false).