Package com.couchbase.client.java.view
Class SpatialViewQuery
- java.lang.Object
-
- com.couchbase.client.java.view.SpatialViewQuery
-
- All Implemented Interfaces:
Serializable
public class SpatialViewQuery extends Object implements Serializable
Fluent DSL for a Spatial View Query.- Since:
- 2.1.0
- Author:
- Michael Nitschinger
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SpatialViewQuerydebug()Enabled debugging on view queries.SpatialViewQuerydebug(boolean debug)SpatialViewQuerydevelopment()SpatialViewQuerydevelopment(boolean development)protected Stringencode(String source)Helper method to properly encode a string.SpatialViewQueryendRange(JsonArray endRange)booleanequals(Object o)static SpatialViewQueryfrom(String design, String view)Creates an newSpatialViewQuery.StringgetDesign()StringgetView()inthashCode()SpatialViewQueryincludeDocs()Proactively load the full document for the row returned.SpatialViewQueryincludeDocs(boolean includeDocs)Proactively load the full document for the row returned.SpatialViewQueryincludeDocs(boolean includeDocs, Class<? extends Document<?>> target)Proactively load the full document for the row returned.SpatialViewQueryincludeDocs(Class<? extends Document<?>> target)Proactively load the full document for the row returned.Class<? extends Document<?>>includeDocsTarget()booleanisDevelopment()booleanisIncludeDocs()SpatialViewQuerylimit(int limit)Limit the number of the returned documents to the specified number.SpatialViewQueryonError(OnError onError)Sets the response in the event of an error.SpatialViewQueryrange(JsonArray startRange, JsonArray endRange)SpatialViewQueryskip(int skip)Skip this number of records before starting to return the results.SpatialViewQuerystale(Stale stale)Allow the results from a stale view to be used.SpatialViewQuerystartRange(JsonArray startRange)StringtoString()
-
-
-
Method Detail
-
from
public static SpatialViewQuery from(String design, String view)
Creates an newSpatialViewQuery.- Parameters:
design- the name of the design document.view- the name of the view.- Returns:
- a
SpatialViewQueryDSL.
-
development
public SpatialViewQuery development()
-
development
public SpatialViewQuery development(boolean development)
-
includeDocs
public SpatialViewQuery includeDocs()
Proactively load the full document for the row returned. This only works if reduce is false, since with reduce the original document ID is not included anymore.- Returns:
- the
SpatialViewQueryDSL.
-
includeDocs
public SpatialViewQuery includeDocs(Class<? extends Document<?>> target)
Proactively load the full document for the row returned. This only works if reduce is false, since with reduce the original document ID is not included anymore.- Parameters:
target- the custom document type target.- Returns:
- the
SpatialViewQueryDSL.
-
includeDocs
public SpatialViewQuery includeDocs(boolean includeDocs)
Proactively load the full document for the row returned. This only works if reduce is false, since with reduce the original document ID is not included anymore.- Parameters:
includeDocs- if it should be enabled or not.- Returns:
- the
SpatialViewQueryDSL.
-
includeDocs
public SpatialViewQuery includeDocs(boolean includeDocs, Class<? extends Document<?>> target)
Proactively load the full document for the row returned. This only works if reduce is false, since with reduce the original document ID is not included anymore.- Parameters:
includeDocs- if it should be enabled or not.target- the custom document type target.- Returns:
- the
SpatialViewQueryDSL.
-
limit
public SpatialViewQuery limit(int limit)
Limit the number of the returned documents to the specified number.- Parameters:
limit- the number of documents to return.- Returns:
- the
SpatialViewQueryobject for proper chaining.
-
skip
public SpatialViewQuery skip(int skip)
Skip this number of records before starting to return the results.- Parameters:
skip- The number of records to skip.- Returns:
- the
SpatialViewQueryobject for proper chaining.
-
stale
public SpatialViewQuery stale(Stale stale)
Allow the results from a stale view to be used. See the "Stale" enum for more information on the possible options. The default setting is "update_after"!- Parameters:
stale- Which stale mode should be used.- Returns:
- the
SpatialViewQueryobject for proper chaining.
-
debug
public SpatialViewQuery debug()
Enabled debugging on view queries.- Returns:
- the
SpatialViewQueryobject for proper chaining.
-
debug
public SpatialViewQuery debug(boolean debug)
-
startRange
public SpatialViewQuery startRange(JsonArray startRange)
-
endRange
public SpatialViewQuery endRange(JsonArray endRange)
-
range
public SpatialViewQuery range(JsonArray startRange, JsonArray endRange)
-
onError
public SpatialViewQuery onError(OnError onError)
Sets the response in the event of an error. See the "OnError" enum for more details on the available options.- Parameters:
onError- The appropriate error handling type.- Returns:
- the
SpatialViewQueryobject for proper chaining.
-
encode
protected String encode(String source)
Helper method to properly encode a string. This method can be overridden if a different encoding logic needs to be used.- Parameters:
source- source string.- Returns:
- encoded target string.
-
getDesign
public String getDesign()
-
getView
public String getView()
-
isDevelopment
public boolean isDevelopment()
-
isIncludeDocs
public boolean isIncludeDocs()
-
-