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 SpatialViewQuery
debug()
Enabled debugging on view queries.SpatialViewQuery
debug(boolean debug)
SpatialViewQuery
development()
SpatialViewQuery
development(boolean development)
protected String
encode(String source)
Helper method to properly encode a string.SpatialViewQuery
endRange(JsonArray endRange)
boolean
equals(Object o)
static SpatialViewQuery
from(String design, String view)
Creates an newSpatialViewQuery
.String
getDesign()
String
getView()
int
hashCode()
SpatialViewQuery
includeDocs()
Proactively load the full document for the row returned.SpatialViewQuery
includeDocs(boolean includeDocs)
Proactively load the full document for the row returned.SpatialViewQuery
includeDocs(boolean includeDocs, Class<? extends Document<?>> target)
Proactively load the full document for the row returned.SpatialViewQuery
includeDocs(Class<? extends Document<?>> target)
Proactively load the full document for the row returned.Class<? extends Document<?>>
includeDocsTarget()
boolean
isDevelopment()
boolean
isIncludeDocs()
SpatialViewQuery
limit(int limit)
Limit the number of the returned documents to the specified number.SpatialViewQuery
onError(OnError onError)
Sets the response in the event of an error.SpatialViewQuery
range(JsonArray startRange, JsonArray endRange)
SpatialViewQuery
skip(int skip)
Skip this number of records before starting to return the results.SpatialViewQuery
stale(Stale stale)
Allow the results from a stale view to be used.SpatialViewQuery
startRange(JsonArray startRange)
String
toString()
-
-
-
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
SpatialViewQuery
DSL.
-
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
SpatialViewQuery
DSL.
-
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
SpatialViewQuery
DSL.
-
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
SpatialViewQuery
DSL.
-
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
SpatialViewQuery
DSL.
-
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
SpatialViewQuery
object 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
SpatialViewQuery
object 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
SpatialViewQuery
object for proper chaining.
-
debug
public SpatialViewQuery debug()
Enabled debugging on view queries.- Returns:
- the
SpatialViewQuery
object 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
SpatialViewQuery
object 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()
-
-