@NotNull
public InputStream query( @NotNull @NonNls String designDocumentId, @NotNull @NonNls String viewId, boolean includeDocs, @Nullable String startKey, @Nullable String endKey ) throws ActionFailedException {
WebResource viewPath = dbRoot.path( "_design" ).path( designDocumentId ).path( "_view" ).path( viewId );
if ( startKey != null ) {
viewPath = viewPath.queryParam( "startkey", startKey );
}
if ( endKey != null ) {
viewPath = viewPath.queryParam( "endkey", endKey );
}