public class ViewQuery extends Object implements Serializable
Modifier and Type | Method and Description |
---|---|
ViewQuery |
debug()
Enabled debugging on view queries.
|
ViewQuery |
debug(boolean debug) |
ViewQuery |
descending()
Return the documents in descending by key order.
|
ViewQuery |
descending(boolean desc) |
ViewQuery |
development() |
ViewQuery |
development(boolean development) |
protected String |
encode(String source)
Helper method to properly encode a string.
|
ViewQuery |
endKey(boolean key) |
ViewQuery |
endKey(double key) |
ViewQuery |
endKey(int key) |
ViewQuery |
endKey(JsonArray key) |
ViewQuery |
endKey(JsonObject key) |
ViewQuery |
endKey(long key) |
ViewQuery |
endKey(String key) |
ViewQuery |
endKeyDocId(String id) |
boolean |
equals(Object o) |
static ViewQuery |
from(String design,
String view)
Creates an new
ViewQuery . |
String |
getDesign() |
String |
getKeys() |
String |
getView() |
ViewQuery |
group()
Group the results using the reduce function to a group or single row.
|
ViewQuery |
group(boolean group) |
ViewQuery |
groupLevel(int grouplevel)
Specify the group level to be used.
|
int |
hashCode() |
ViewQuery |
includeDocs()
Proactively load the full document for the row returned.
|
ViewQuery |
includeDocs(boolean includeDocs)
Proactively load the full document for the row returned.
|
ViewQuery |
includeDocs(boolean includeDocs,
Class<? extends Document<?>> target)
Proactively load the full document for the row returned.
|
ViewQuery |
includeDocs(Class<? extends Document<?>> target)
Proactively load the full document for the row returned.
|
ViewQuery |
includeDocsOrdered()
Proactively load the full document for the row returned, while strictly retaining view row order.
|
ViewQuery |
includeDocsOrdered(boolean includeDocs)
Proactively load the full document for the row returned, while strictly retaining view row order.
|
ViewQuery |
includeDocsOrdered(boolean includeDocs,
Class<? extends Document<?>> target)
Proactively load the full document for the row returned, while strictly retaining view row order.
|
ViewQuery |
includeDocsOrdered(Class<? extends Document<?>> target)
Proactively load the full document for the row returned, while strictly retaining view row order.
|
Class<? extends Document<?>> |
includeDocsTarget() |
ViewQuery |
inclusiveEnd()
Specifies whether the specified end key should be included in the result.
|
ViewQuery |
inclusiveEnd(boolean inclusive) |
boolean |
isDevelopment() |
boolean |
isIncludeDocs() |
boolean |
isOrderRetained() |
ViewQuery |
key(boolean key) |
ViewQuery |
key(double key) |
ViewQuery |
key(int key) |
ViewQuery |
key(JsonArray key) |
ViewQuery |
key(JsonObject key) |
ViewQuery |
key(long key) |
ViewQuery |
key(String key) |
ViewQuery |
keys(JsonArray keys) |
ViewQuery |
limit(int limit)
Limit the number of the returned documents to the specified number.
|
ViewQuery |
onError(OnError onError)
Sets the response in the event of an error.
|
ViewQuery |
reduce() |
ViewQuery |
reduce(boolean reduce)
Explicitly enable/disable the reduce function on the query.
|
ViewQuery |
skip(int skip)
Skip this number of records before starting to return the results.
|
ViewQuery |
stale(Stale stale)
Allow the results from a stale view to be used.
|
ViewQuery |
startKey(boolean key) |
ViewQuery |
startKey(double key) |
ViewQuery |
startKey(int key) |
ViewQuery |
startKey(JsonArray key) |
ViewQuery |
startKey(JsonObject key) |
ViewQuery |
startKey(long key) |
ViewQuery |
startKey(String key) |
ViewQuery |
startKeyDocId(String id) |
String |
toQueryString()
Returns the query string for this ViewQuery, containing all the key/value pairs
for parameters that will be part of this ViewQuery's execution URL for the view service.
|
String |
toString()
A string representation of this ViewQuery, suitable for logging and other human consumption.
|
public static ViewQuery from(String design, String view)
ViewQuery
.design
- the name of the design document.view
- the name of the view.ViewQuery
DSL.public ViewQuery development()
public ViewQuery development(boolean development)
public ViewQuery includeDocsOrdered()
ViewQuery
DSL.public ViewQuery includeDocsOrdered(Class<? extends Document<?>> target)
target
- the custom document type target.ViewQuery
DSL.public ViewQuery includeDocsOrdered(boolean includeDocs)
includeDocs
- if it should be enabled or not.ViewQuery
DSL.public ViewQuery includeDocsOrdered(boolean includeDocs, Class<? extends Document<?>> target)
includeDocs
- if it should be enabled or not.target
- the custom document type target.ViewQuery
DSL.public ViewQuery includeDocs()
includeDocsOrdered()
)} if you want to enforce the row order).ViewQuery
DSL.public ViewQuery includeDocs(Class<? extends Document<?>> target)
includeDocsOrdered(Class)
)} if you want to enforce the row order).target
- the custom document type target.ViewQuery
DSL.public ViewQuery includeDocs(boolean includeDocs)
includeDocsOrdered(boolean)
if you want to enforce the row order).includeDocs
- if it should be enabled or not.ViewQuery
DSL.public ViewQuery includeDocs(boolean includeDocs, Class<? extends Document<?>> target)
includeDocsOrdered(boolean, Class)
if you want to enforce the row order).includeDocs
- if it should be enabled or not.target
- the custom document type target.ViewQuery
DSL.public ViewQuery reduce(boolean reduce)
reduce
- if reduce should be enabled or not.ViewQuery
object for proper chaining.public ViewQuery reduce()
public ViewQuery limit(int limit)
limit
- the number of documents to return.ViewQuery
object for proper chaining.public ViewQuery group()
groupLevel(int)
should not be used
together in the same ViewQuery
. 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.ViewQuery
object for proper chaining.public ViewQuery group(boolean group)
public ViewQuery groupLevel(int grouplevel)
group()
and this setter should not be used
together in the same ViewQuery
. It is sufficient to only use this
setter and use group()
in cases where you always want
the highest group level implictly.grouplevel
- How deep the grouping level should be.ViewQuery
object for proper chaining.public ViewQuery inclusiveEnd()
ViewQuery
object for proper chaining.public ViewQuery inclusiveEnd(boolean inclusive)
public ViewQuery skip(int skip)
skip
- The number of records to skip.ViewQuery
object for proper chaining.public ViewQuery stale(Stale stale)
stale
- Which stale mode should be used.ViewQuery
object for proper chaining.public ViewQuery onError(OnError onError)
onError
- The appropriate error handling type.ViewQuery
object for proper chaining.public ViewQuery debug()
ViewQuery
object for proper chaining.public ViewQuery debug(boolean debug)
public ViewQuery descending()
ViewQuery
object for proper chaining.public ViewQuery descending(boolean desc)
public ViewQuery key(int key)
public ViewQuery key(long key)
public ViewQuery key(double key)
public ViewQuery key(boolean key)
public ViewQuery key(JsonObject key)
public ViewQuery endKey(int key)
public ViewQuery endKey(long key)
public ViewQuery endKey(double key)
public ViewQuery endKey(boolean key)
public ViewQuery endKey(JsonObject key)
public ViewQuery startKey(int key)
public ViewQuery startKey(long key)
public ViewQuery startKey(double key)
public ViewQuery startKey(boolean key)
public ViewQuery startKey(JsonObject key)
protected String encode(String source)
keys
is not encoded via
this method, but by the core.source
- source string.public String toQueryString()
public String toString()
keys(JsonArray)
parameter is too large, it is truncated in this dump.
see the toQueryString()
for the parameter representation of the ViewQuery execution URL.public String getDesign()
public String getView()
public boolean isOrderRetained()
including docs
.public boolean isDevelopment()
public boolean isIncludeDocs()
Copyright © 2015 Couchbase, Inc.