Package com.couchbase.client.java.view
Class ViewOptions
- java.lang.Object
-
- com.couchbase.client.java.CommonOptions<ViewOptions>
-
- com.couchbase.client.java.view.ViewOptions
-
public class ViewOptions extends CommonOptions<ViewOptions>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classViewOptions.Built-
Nested classes/interfaces inherited from class com.couchbase.client.java.CommonOptions
CommonOptions.BuiltCommonOptions
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ViewOptions.Builtbuild()ViewOptionsdebug(boolean debug)Enable debugging on view queries.ViewOptionsendKey(boolean key)ViewOptionsendKey(double key)ViewOptionsendKey(int key)ViewOptionsendKey(long key)ViewOptionsendKey(JsonArray key)ViewOptionsendKey(JsonObject key)ViewOptionsendKey(String key)ViewOptionsendKeyDocId(String id)ViewOptionsgroup(boolean group)Group the results using the reduce function to a group or single row.ViewOptionsgroupLevel(int grouplevel)Specify the group level to be used.ViewOptionsinclusiveEnd(boolean inclusive)Specifies whether the specified end key should be included in the result.ViewOptionskey(boolean key)ViewOptionskey(double key)ViewOptionskey(int key)ViewOptionskey(long key)ViewOptionskey(JsonArray key)ViewOptionskey(JsonObject key)ViewOptionskey(String key)ViewOptionskeys(JsonArray keys)ViewOptionslimit(int limit)Limit the number of the returned documents to the specified number.ViewOptionsnamespace(DesignDocumentNamespace namespace)ViewOptionsonError(ViewErrorMode viewErrorMode)Sets the response in the event of an error.ViewOptionsorder(ViewOrdering ordering)Return the documents in descending key order.ViewOptionsraw(String key, String value)ViewOptionsreduce(boolean reduce)Explicitly enable/disable the reduce function on the query.ViewOptionsscanConsistency(ViewScanConsistency scanConsistency)Sets the scan consistency (staleness) of a view query.ViewOptionsserializer(JsonSerializer serializer)ViewOptionsskip(int skip)Skip this number of records before starting to return the results.ViewOptionsstartKey(boolean key)ViewOptionsstartKey(double key)ViewOptionsstartKey(int key)ViewOptionsstartKey(long key)ViewOptionsstartKey(JsonArray key)ViewOptionsstartKey(JsonObject key)ViewOptionsstartKey(String key)ViewOptionsstartKeyDocId(String id)StringtoString()A string representation of this ViewQuery, suitable for logging and other human consumption.static ViewOptionsviewOptions()-
Methods inherited from class com.couchbase.client.java.CommonOptions
clientContext, parentSpan, retryStrategy, self, timeout
-
-
-
-
Method Detail
-
viewOptions
public static ViewOptions viewOptions()
-
namespace
public ViewOptions namespace(DesignDocumentNamespace namespace)
-
serializer
public ViewOptions serializer(JsonSerializer serializer)
-
reduce
public ViewOptions reduce(boolean reduce)
Explicitly enable/disable the reduce function on the query.- Parameters:
reduce- if reduce should be enabled or not.- Returns:
- the
ViewOptionsobject for proper chaining.
-
limit
public ViewOptions limit(int limit)
Limit the number of the returned documents to the specified number.- Parameters:
limit- the number of documents to return.- Returns:
- the
ViewOptionsobject for proper chaining.
-
group
public ViewOptions group(boolean group)
Group the results using the reduce function to a group or single row.Important: this setter and
groupLevel(int)should not be used together in the sameViewOptions. It is sufficient to only set the grouping level only and use this setter in cases where you always want the highest group level implictly.- Returns:
- the
ViewOptionsobject for proper chaining.
-
groupLevel
public ViewOptions groupLevel(int grouplevel)
Specify the group level to be used.Important:
group(boolean)and this setter should not be used together in the sameViewOptions. It is sufficient to only use this setter and usegroup(boolean)in cases where you always want the highest group level implicitly.- Parameters:
grouplevel- How deep the grouping level should be.- Returns:
- the
ViewOptionsobject for proper chaining.
-
inclusiveEnd
public ViewOptions inclusiveEnd(boolean inclusive)
Specifies whether the specified end key should be included in the result.- Returns:
- the
ViewOptionsobject for proper chaining.
-
skip
public ViewOptions skip(int skip)
Skip this number of records before starting to return the results.- Parameters:
skip- The number of records to skip.- Returns:
- the
ViewOptionsobject for proper chaining.
-
scanConsistency
public ViewOptions scanConsistency(ViewScanConsistency scanConsistency)
Sets the scan consistency (staleness) of a view query.- Parameters:
scanConsistency- Which consistency mode should be used.- Returns:
- the
ViewOptionsobject for proper chaining.
-
onError
public ViewOptions onError(ViewErrorMode viewErrorMode)
Sets the response in the event of an error.See the "OnError" enum for more details on the available options.
- Parameters:
viewErrorMode- The appropriate error handling type.- Returns:
- the
ViewOptionsobject for proper chaining.
-
debug
public ViewOptions debug(boolean debug)
Enable debugging on view queries.- Returns:
- the
ViewOptionsobject for proper chaining.
-
order
public ViewOptions order(ViewOrdering ordering)
Return the documents in descending key order.- Returns:
- the
ViewOptionsobject for proper chaining.
-
key
public ViewOptions key(String key)
-
key
public ViewOptions key(int key)
-
key
public ViewOptions key(long key)
-
key
public ViewOptions key(double key)
-
key
public ViewOptions key(boolean key)
-
key
public ViewOptions key(JsonObject key)
-
key
public ViewOptions key(JsonArray key)
-
keys
public ViewOptions keys(JsonArray keys)
-
startKeyDocId
public ViewOptions startKeyDocId(String id)
-
endKeyDocId
public ViewOptions endKeyDocId(String id)
-
endKey
public ViewOptions endKey(String key)
-
endKey
public ViewOptions endKey(int key)
-
endKey
public ViewOptions endKey(long key)
-
endKey
public ViewOptions endKey(double key)
-
endKey
public ViewOptions endKey(boolean key)
-
endKey
public ViewOptions endKey(JsonObject key)
-
endKey
public ViewOptions endKey(JsonArray key)
-
startKey
public ViewOptions startKey(String key)
-
startKey
public ViewOptions startKey(int key)
-
startKey
public ViewOptions startKey(long key)
-
startKey
public ViewOptions startKey(double key)
-
startKey
public ViewOptions startKey(boolean key)
-
startKey
public ViewOptions startKey(JsonObject key)
-
startKey
public ViewOptions startKey(JsonArray key)
-
raw
public ViewOptions raw(String key, String value)
-
toString
public String toString()
A string representation of this ViewQuery, suitable for logging and other human consumption. If thekeys(JsonArray)parameter is too large, it is truncated in this dump.see the
export()()} for the parameter representation of the ViewQuery execution URL.
-
build
@Internal public ViewOptions.Built build()
-
-