<private> new DefaultViewQuery()
Class for dynamically constructing normal view queries (non-spatial). You must use ViewQuery.from to construct this object.
- Since:
-
- 2.0.0 (stability: committed)
Extends
Methods
-
custom(opts) → {ViewQuery}
-
Allows you to specify custom view options that may not be available though the fluent interface defined by this class.
Parameters:
Name Type Description opts
Object - Since:
-
- 2.0.0 (stability: committed)
- Inherited From:
Returns:
- Type
- ViewQuery
-
from(ddoc, name) → {ViewQuery}
-
Specifies the design document and view name to use for this query.
Parameters:
Name Type Description ddoc
string The design document to use.
name
string The view to use.
- Since:
-
- 2.0.0 (stability: committed)
- Inherited From:
Returns:
- Type
- ViewQuery
-
group(group_level) → {DefaultViewQuery}
-
Specifies at what level to perform result grouping. These levels map to indexes within the emitted key arrays. A value of -1 indicates to not perform any grouping.
Parameters:
Name Type Description group_level
number - Since:
-
- 2.0.0 (stability: committed)
Returns:
- Type
- DefaultViewQuery
-
id_range(start, end) → {DefaultViewQuery}
-
Specifies a range of document id's to retrieve from the index.
Parameters:
Name Type Description start
string | undefined end
string | undefined - Since:
-
- 2.0.0 (stability: committed)
Returns:
- Type
- DefaultViewQuery
-
key(key) → {DefaultViewQuery}
-
Specifies a specified key to retrieve from the index.
Parameters:
Name Type Description key
string - Since:
-
- 2.0.0 (stability: committed)
Returns:
- Type
- DefaultViewQuery
-
keys(keys) → {DefaultViewQuery}
-
Specifies a list of keys you wish to retrieve from the index.
Parameters:
Name Type Description keys
Array.<string> - Since:
-
- 2.0.0 (stability: committed)
Returns:
- Type
- DefaultViewQuery
-
limit(limit) → {ViewQuery}
-
Specifies the maximum number of results to return.
Parameters:
Name Type Description limit
number - Since:
-
- 2.0.0 (stability: committed)
- Inherited From:
Returns:
- Type
- ViewQuery
-
order(order) → {DefaultViewQuery}
-
Specifies the desired ordering for the results.
Parameters:
Name Type Description order
ViewQuery.Order - Since:
-
- 2.0.0 (stability: committed)
Returns:
- Type
- DefaultViewQuery
-
range(start, end, inclusive_end) → {DefaultViewQuery}
-
Specifies a range of keys to retrieve from the index. You may specify both a start and an end point and additionally specify whether or not the end value is inclusive or exclusive.
Parameters:
Name Type Argument Description start
string | undefined end
string | undefined inclusive_end
boolean <optional>
- Since:
-
- 2.0.0 (stability: committed)
Returns:
- Type
- DefaultViewQuery
-
reduce(reduce) → {DefaultViewQuery}
-
Specifies whether to execute the map-reduce reduce step.
Parameters:
Name Type Description reduce
boolean - Since:
-
- 2.0.0 (stability: committed)
Returns:
- Type
- DefaultViewQuery
-
skip(skip) → {ViewQuery}
-
Specifies how many results to skip from the beginning of the result set.
Parameters:
Name Type Description skip
number - Since:
-
- 2.0.0 (stability: committed)
- Inherited From:
Returns:
- Type
- ViewQuery
-
stale(stale) → {ViewQuery}
-
Specifies how this query will affect view indexing, both before and after the query is executed.
Parameters:
Name Type Description stale
ViewQuery.Update How to update the index.
- Since:
-
- 2.0.0 (stability: committed)
- Inherited From:
- Default Value:
-
- ViewQuery.Update.NONE
Returns:
- Type
- ViewQuery