public interface AllDocsRequestBuilder extends RequestBuilder<AllDocsRequestBuilder>, SettableViewParameters.Unpaginated<java.lang.String,AllDocsRequestBuilder>
Example usage:
AllDocsRequest allDocsRequest =
//get a request builder for the "_all_docs" endpoint
db.getAllDocsRequestBuilder()
//set any other required parameters e.g. doc id of "foo" or "bar"
.keys("foo", "bar")
//build the request
.build();
Example to list all the document IDs in a database:
List<String> allDocIds = db.getAllDocsRequestBuilder().build().getResponse().getDocIds();
Example to fetch all the documents in the database:
List<Foo> allFoos = db.getAllDocsRequestBuilder().includeDocs(true).build()
.getRepsonse().getDocsAs(Foo.class);
Example to fetch multiple documents, with the specified document IDs from the database:
String[] docIds = new String[]{"doc-id-1", "doc-id-2"};
List<Foo> foosWithIds = db.getAllDocsRequestBuilder().keys(docIds).includeDocs(true).build()
.getRepsonse().getDocsAs(Foo.class);
AllDocsRequest
,
AllDocsResponse
Modifier and Type | Method and Description |
---|---|
AllDocsRequest |
build() |
returnThis
limit, skip
descending, endKey, endKeyDocId, includeDocs, inclusiveEnd, keys, partition, stable, stale, startKey, startKeyDocId, update
AllDocsRequest build()