see on GitHub

Commands: Documents: Stream

StreamDocs is used to stream documents which match chosen criteria from a database.

Syntax

public CloseableIterator<RavenJObject> streamDocs();

public CloseableIterator<RavenJObject> streamDocs(Etag fromEtag);

public CloseableIterator<RavenJObject> streamDocs(Etag fromEtag, String startsWith);

public CloseableIterator<RavenJObject> streamDocs(Etag fromEtag, String startsWith, String matches);

public CloseableIterator<RavenJObject> streamDocs(Etag fromEtag, String startsWith, String matches, int start);

public CloseableIterator<RavenJObject> streamDocs(Etag fromEtag, String startsWith, String matches, int start, int pageSize);

public CloseableIterator<RavenJObject> streamDocs(Etag fromEtag, String startsWith, String matches, int start, int pageSize, String exclude);

public CloseableIterator<RavenJObject> streamDocs(Etag fromEtag, String startsWith, String matches, int start, int pageSize, String exclude, RavenPagingInformation pagingInformation);

public CloseableIterator<RavenJObject> streamDocs(Etag fromEtag, String startsWith, String matches, int start, int pageSize, String exclude, RavenPagingInformation pagingInformation, String skipAfter);

Parameters
fromEtag Etag ETag of a document from which stream should start (mutually exclusive with 'startsWith') (default: null)
startsWith String prefix for which documents should be streamed (mutually exclusive with 'fromEtag') (default: null)
matches String pipe ('|') separated values for which document keys (after 'keyPrefix') should be matched ('?' any single character, '*' any characters) (default: null)
start int number of documents that should be skipped (default: 0)
pageSize int maximum number of documents that will be retrieved (default: Integer.MAX_VALUE)
exclude int pipe ('|') separated values for which document keys (after 'keyPrefix') should not be matched ('?' any single character, '*' any characters) (default: null)
pagingInformation RavenPagingInformation used to perform rapid pagination on a server side (default: null)
skipAfter String skip document fetching until given key is found and return documents after that key (default: null)

Example

try (CloseableIterator<RavenJObject> iterator = store.getDatabaseCommands().streamDocs(null, "products/")) {
  while (iterator.hasNext()) {
    RavenJObject document = iterator.next();
  }
}