Class ViewOptions

java.lang.Object
com.couchbase.client.java.CommonOptions<ViewOptions>
com.couchbase.client.java.view.ViewOptions

public class ViewOptions extends CommonOptions<ViewOptions>
  • Method Details Link icon

    • viewOptions Link icon

      public static ViewOptions viewOptions()
    • namespace Link icon

      public ViewOptions namespace(DesignDocumentNamespace namespace)
    • serializer Link icon

      public ViewOptions serializer(JsonSerializer serializer)
    • reduce Link icon

      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 ViewOptions object for proper chaining.
    • limit Link icon

      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 ViewOptions object for proper chaining.
    • group Link icon

      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 same ViewOptions. 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 ViewOptions object for proper chaining.
    • groupLevel Link icon

      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 same ViewOptions. It is sufficient to only use this setter and use group(boolean) in cases where you always want the highest group level implicitly.

      Parameters:
      grouplevel - How deep the grouping level should be.
      Returns:
      the ViewOptions object for proper chaining.
    • inclusiveEnd Link icon

      public ViewOptions inclusiveEnd(boolean inclusive)
      Specifies whether the specified end key should be included in the result.
      Returns:
      the ViewOptions object for proper chaining.
    • skip Link icon

      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 ViewOptions object for proper chaining.
    • scanConsistency Link icon

      public ViewOptions scanConsistency(ViewScanConsistency scanConsistency)
      Sets the scan consistency (staleness) of a view query.
      Parameters:
      scanConsistency - Which consistency mode should be used.
      Returns:
      the ViewOptions object for proper chaining.
    • onError Link icon

      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 ViewOptions object for proper chaining.
    • debug Link icon

      public ViewOptions debug(boolean debug)
      Enable debugging on view queries.
      Returns:
      the ViewOptions object for proper chaining.
    • order Link icon

      public ViewOptions order(ViewOrdering ordering)
      Return the documents in descending key order.
      Returns:
      the ViewOptions object for proper chaining.
    • key Link icon

      public ViewOptions key(String key)
    • key Link icon

      public ViewOptions key(int key)
    • key Link icon

      public ViewOptions key(long key)
    • key Link icon

      public ViewOptions key(double key)
    • key Link icon

      public ViewOptions key(boolean key)
    • key Link icon

      public ViewOptions key(JsonObject key)
    • key Link icon

      public ViewOptions key(JsonArray key)
    • keys Link icon

      public ViewOptions keys(JsonArray keys)
    • startKeyDocId Link icon

      public ViewOptions startKeyDocId(String id)
    • endKeyDocId Link icon

      public ViewOptions endKeyDocId(String id)
    • endKey Link icon

      public ViewOptions endKey(String key)
    • endKey Link icon

      public ViewOptions endKey(int key)
    • endKey Link icon

      public ViewOptions endKey(long key)
    • endKey Link icon

      public ViewOptions endKey(double key)
    • endKey Link icon

      public ViewOptions endKey(boolean key)
    • endKey Link icon

      public ViewOptions endKey(JsonObject key)
    • endKey Link icon

      public ViewOptions endKey(JsonArray key)
    • startKey Link icon

      public ViewOptions startKey(String key)
    • startKey Link icon

      public ViewOptions startKey(int key)
    • startKey Link icon

      public ViewOptions startKey(long key)
    • startKey Link icon

      public ViewOptions startKey(double key)
    • startKey Link icon

      public ViewOptions startKey(boolean key)
    • startKey Link icon

      public ViewOptions startKey(JsonObject key)
    • startKey Link icon

      public ViewOptions startKey(JsonArray key)
    • raw Link icon

      public ViewOptions raw(String key, String value)
    • toString Link icon

      public String toString()
      A string representation of this ViewQuery, suitable for logging and other human consumption. If the keys(JsonArray) parameter is too large, it is truncated in this dump.

      see the export() ()} for the parameter representation of the ViewQuery execution URL.

      Overrides:
      toString in class Object
    • build Link icon

      @Internal public ViewOptions.Built build()