public class Query
extends java.lang.Object
| Constructor and Description |
|---|
Query()
Creates a new Query object with default settings.
|
| Modifier and Type | Method and Description |
|---|---|
Query |
copy()
Creates a new query instance and returns it with the properties
bound to the current object.
|
java.util.Map<java.lang.String,java.lang.Object> |
getArgs()
Returns all current args for proper inspection.
|
int |
getLimit()
Returns the currently set limit.
|
Query |
setBbox(double lowerLeftLong,
double lowerLeftLat,
double upperRightLong,
double upperRightLat)
Sets the params for a spatial bounding box view query.
|
Query |
setDebug(boolean debug)
Enabled debugging on view queries.
|
Query |
setDescending(boolean descending)
Return the documents in descending by key order.
|
Query |
setEndkeyDocID(java.lang.String endkeydocid)
Stop returning records when the specified document ID is reached.
|
Query |
setGroup(boolean group)
Group the results using the reduce function to a group or single row.
|
Query |
setGroupLevel(int grouplevel)
Specify the group level to be used.
|
Query |
setIncludeDocs(boolean include)
If the full documents should be included in the result.
|
Query |
setInclusiveEnd(boolean inclusiveend)
Specifies whether the specified end key should be included in the result.
|
Query |
setKey(ComplexKey key)
Return only documents that match the specified key.
|
Query |
setKey(java.lang.String key)
Return only documents that match the specified key.
|
Query |
setKeys(ComplexKey keys)
Return only documents that match each of keys specified within the given
array.
|
Query |
setKeys(java.lang.String keys)
Return only documents that match each of keys specified within the given
array.
|
Query |
setLimit(int limit)
Limit the number of the returned documents to the specified number.
|
Query |
setOnError(OnError opt)
Sets the response in the event of an error.
|
Query |
setRange(ComplexKey startkey,
ComplexKey endkey)
Returns records in the given key range.
|
Query |
setRange(java.lang.String startkey,
java.lang.String endkey)
Returns records in the given key range.
|
Query |
setRangeEnd(ComplexKey endkey)
Stop returning records when the specified key is reached.
|
Query |
setRangeEnd(java.lang.String endkey)
Stop returning records when the specified key is reached.
|
Query |
setRangeStart(ComplexKey startkey)
Return records with a value equal to or greater than the specified key.
|
Query |
setRangeStart(java.lang.String startkey)
Return records with a value equal to or greater than the specified key.
|
Query |
setReduce(java.lang.Boolean reduce)
Use the reduction function.
|
Query |
setSkip(int docstoskip)
Skip this number of records before starting to return the results.
|
Query |
setStale(Stale stale)
Allow the results from a stale view to be used.
|
Query |
setStartkeyDocID(java.lang.String startkeydocid)
Return records starting with the specified document ID.
|
java.lang.String |
toString()
Returns the Query object as a string, suitable for the HTTP queries.
|
boolean |
willIncludeDocs()
Read if full documents will be included on the query.
|
boolean |
willReduce()
Read if reduce is enabled or not.
|
public boolean willReduce()
public boolean willIncludeDocs()
public Query setDescending(boolean descending)
descending - True if the sort-order should be descending.public Query setEndkeyDocID(java.lang.String endkeydocid)
endkeydocid - The document ID that should be used.public Query setGroup(boolean group)
group - True when grouping should be enabled.public Query setGroupLevel(int grouplevel)
grouplevel - How deep the grouping level should be.public Query setIncludeDocs(boolean include)
include - True when the full docs should be included in the result.public Query setInclusiveEnd(boolean inclusiveend)
inclusiveend - True when the key should be included.public Query setKey(ComplexKey key)
key - The document key.public Query setKey(java.lang.String key)
key - The document key.public Query setKeys(ComplexKey keys)
keys - The document keys.public Query setKeys(java.lang.String keys)
keys - The document keys.public Query setLimit(int limit)
limit - The number of documents to return.public int getLimit()
public Query setRange(java.lang.String startkey, java.lang.String endkey)
startkey - The start of the key range.endkey - The end of the key range.public Query setRange(ComplexKey startkey, ComplexKey endkey)
startkey - The start of the key range.endkey - The end of the key range.public Query setRangeStart(java.lang.String startkey)
startkey - The start of the key range.public Query setRangeStart(ComplexKey startkey)
startkey - The start of the key range.public Query setReduce(java.lang.Boolean reduce)
reduce - True if the reduce phase should also be executed.public Query setRangeEnd(java.lang.String endkey)
endkey - The end of the key range.public Query setRangeEnd(ComplexKey endkey)
endkey - The end of the key range.public Query setSkip(int docstoskip)
docstoskip - The number of records to skip.public Query setStale(Stale stale)
stale - Which stale mode should be used.public Query setStartkeyDocID(java.lang.String startkeydocid)
startkeydocid - The document ID to match.public Query setOnError(OnError opt)
opt - The appropriate error handling type.public Query setBbox(double lowerLeftLong, double lowerLeftLat, double upperRightLong, double upperRightLat)
lowerLeftLong - The longitude of the lower left corner.lowerLeftLat - The latitude of the lower left corner.upperRightLong - The longitude of the upper right corner.upperRightLat - The latitude of the upper right corner.public Query setDebug(boolean debug)
debug - True when debugging should be enabled.public Query copy()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.util.Map<java.lang.String,java.lang.Object> getArgs()
Copyright © 2006-2009 Dustin Sallings, 2009-2012 Couchbase, Inc.