public class ViewQuery extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ViewQuery.Keys |
Constructor and Description |
---|
ViewQuery() |
ViewQuery(com.fasterxml.jackson.databind.ObjectMapper om)
Bring your own ObjectMapper.
|
Modifier and Type | Method and Description |
---|---|
ViewQuery |
allDocs()
Will automatically set the query special _all_docs URI.
|
String |
buildQuery() |
ViewQuery |
cacheOk(boolean b)
If set to true, the view query result will be cached and subsequent queries
(with cacheOk set) may be served from the cache instead of the db.
|
ViewQuery |
clone() |
ViewQuery |
dbPath(String s) |
ViewQuery |
descending(boolean b)
View rows are sorted by the key; specifying descending=true will reverse their order.
|
ViewQuery |
designDocId(String s) |
ViewQuery |
endDocId(String s) |
ViewQuery |
endKey(boolean b) |
ViewQuery |
endKey(double d) |
ViewQuery |
endKey(float f) |
ViewQuery |
endKey(int i) |
ViewQuery |
endKey(long l) |
ViewQuery |
endKey(Object o) |
ViewQuery |
endKey(String s) |
boolean |
equals(Object obj) |
String |
getDbPath() |
String |
getDesignDocId() |
String |
getEndDocId() |
Object |
getEndKey() |
int |
getGroupLevel() |
Object |
getKey() |
String |
getKeysAsJson() |
int |
getLimit() |
int |
getSkip() |
String |
getStartDocId() |
Object |
getStartKey() |
String |
getViewName() |
ViewQuery |
group(boolean b)
The group option controls whether the reduce function reduces to a set of distinct keys or to a single result row.
|
ViewQuery |
groupLevel(int i) |
int |
hashCode() |
boolean |
hasMultipleKeys() |
ViewQuery |
includeDocs(boolean b)
The include_docs option will include the associated document.
|
ViewQuery |
inclusiveEnd(boolean b)
The inclusive_end option controls whether the endkey is included in the result.
|
boolean |
isCacheOk() |
boolean |
isDescending() |
boolean |
isGroup() |
boolean |
isIgnoreNotFound() |
boolean |
isIncludeDocs() |
boolean |
isInclusiveEnd() |
boolean |
isReduce() |
boolean |
isStaleOk() |
boolean |
isUpdateSeq() |
ViewQuery |
key(boolean b) |
ViewQuery |
key(double d) |
ViewQuery |
key(float f) |
ViewQuery |
key(int i) |
ViewQuery |
key(long l) |
ViewQuery |
key(Object o) |
ViewQuery |
key(String s) |
ViewQuery |
keys(Collection<?> keyList)
For multiple-key queries (as of CouchDB 0.9).
|
ViewQuery |
limit(int i)
limit=0 you don't get any data, but all meta-data for this View.
|
ViewQuery |
listName(String s) |
ViewQuery |
queryParam(String name,
String value) |
ViewQuery |
rawEndKey(String s) |
ViewQuery |
rawKey(String s) |
ViewQuery |
rawStartKey(String s) |
ViewQuery |
reduce(boolean b)
If a view contains both a map and reduce function, querying that view will by default return the result of the reduce function.
|
void |
reset()
Resets internal state so this builder can be used again.
|
void |
setIgnoreNotFound(boolean ignoreNotFound) |
ViewQuery |
skip(int i)
The skip option should only be used with small values, as skipping a large range of documents this way is inefficient (it scans the index from the startkey and then skips N elements, but still needs to read all the index values to do that).
|
ViewQuery |
staleOk(boolean b)
The stale option can be used for higher performance at the cost of possibly not seeing the all latest data.
|
ViewQuery |
staleOkUpdateAfter()
Same as staleOk(true) but will also trigger a rebuild of the view index after the results of the view have been retrieved.
|
ViewQuery |
startDocId(String s) |
ViewQuery |
startKey(boolean b) |
ViewQuery |
startKey(double d) |
ViewQuery |
startKey(float f) |
ViewQuery |
startKey(int i) |
ViewQuery |
startKey(long l) |
ViewQuery |
startKey(Object o) |
ViewQuery |
startKey(String s) |
String |
toString() |
ViewQuery |
updateSeq(boolean b)
The update_seq option adds a field to the result indicating the update_seq the view reflects.
|
ViewQuery |
viewName(String s) |
public ViewQuery()
public ViewQuery(com.fasterxml.jackson.databind.ObjectMapper om)
om
- public String getDbPath()
public String getDesignDocId()
public String getViewName()
public String getStartDocId()
public String getEndDocId()
public int getLimit()
public boolean isStaleOk()
public boolean isDescending()
public int getSkip()
public boolean isGroup()
public int getGroupLevel()
public boolean isReduce()
public boolean isIncludeDocs()
public boolean isInclusiveEnd()
public boolean isUpdateSeq()
public ViewQuery allDocs()
public ViewQuery cacheOk(boolean b)
b
- public boolean isCacheOk()
public ViewQuery key(String s)
Will
- be JSON-encoded.public ViewQuery rawKey(String s)
Will
- be parsed as JSON.public ViewQuery key(int i)
Will
- be JSON-encoded.public ViewQuery key(long l)
Will
- be JSON-encoded.public ViewQuery key(float f)
Will
- be JSON-encoded.public ViewQuery key(double d)
Will
- be JSON-encoded.public ViewQuery key(boolean b)
Will
- be JSON-encoded.public ViewQuery key(Object o)
Will
- be JSON-encoded.public ViewQuery keys(Collection<?> keyList)
keyList
- a list of Object, will be JSON encoded according to each element's type.public ViewQuery startKey(String s)
Will
- be JSON-encoded.public ViewQuery rawStartKey(String s)
Will
- be parsed as jsonpublic ViewQuery startKey(int i)
Will
- be JSON-encoded.public ViewQuery startKey(long l)
Will
- be JSON-encoded.public ViewQuery startKey(float f)
Will
- be JSON-encoded.public ViewQuery startKey(double d)
Will
- be JSON-encoded.public ViewQuery startKey(boolean b)
Will
- be JSON-encoded.public ViewQuery startKey(Object o)
Will
- be JSON-encoded.public ViewQuery endKey(String s)
will
- be JSON-encoded.public ViewQuery rawEndKey(String s)
will
- be parsed as JSON.public ViewQuery endKey(int i)
Will
- be JSON-encoded.public ViewQuery endKey(long l)
Will
- be JSON-encoded.public ViewQuery endKey(float f)
Will
- be JSON-encoded.public ViewQuery endKey(double d)
Will
- be JSON-encoded.public ViewQuery endKey(boolean b)
Will
- be JSON-encoded.public ViewQuery endKey(Object o)
Will
- be JSON-encoded.public ViewQuery limit(int i)
i
- the limitpublic ViewQuery staleOk(boolean b)
b
- the staleOk flagpublic ViewQuery staleOkUpdateAfter()
public ViewQuery descending(boolean b)
b
- the descending flagpublic ViewQuery skip(int i)
i
- the skip countpublic ViewQuery group(boolean b)
b
- the group flagpublic ViewQuery groupLevel(int i)
public ViewQuery reduce(boolean b)
b
- the reduce flagpublic ViewQuery includeDocs(boolean b)
b
- the includeDocs flagpublic ViewQuery inclusiveEnd(boolean b)
b
- the inclusiveEnd flagpublic ViewQuery updateSeq(boolean b)
b
- the updateSeq flagpublic void reset()
public Object getKey()
public boolean hasMultipleKeys()
public String getKeysAsJson()
public Object getStartKey()
public Object getEndKey()
public String buildQuery()
public void setIgnoreNotFound(boolean ignoreNotFound)
public boolean isIgnoreNotFound()
Copyright © 2013. All Rights Reserved.