public class FindByIndexOptions
extends java.lang.Object
Example:
database.findByIndex( " \"selector\": { \"Movie_year\": {\"$gt\": 1960}, \"Person_name\": \"Alec Guinness\" }" Movie.class, new FindByIndexOptions() .sort(new IndexField("Movie_year", SortOrder.desc)) .fields("Movie_name").fields("Movie_year") .limit(1) .skip(1) .readQuorum(2));
Database.findByIndex(String, Class, FindByIndexOptions)
Constructor and Description |
---|
FindByIndexOptions() |
Modifier and Type | Method and Description |
---|---|
FindByIndexOptions |
fields(java.lang.String field)
Can be called multiple times to set the list of return fields
|
java.util.List<java.lang.String> |
getFields() |
java.lang.Integer |
getLimit() |
java.lang.Integer |
getReadQuorum() |
java.lang.Integer |
getSkip() |
java.util.List<IndexField> |
getSort() |
java.lang.String |
getUseIndex() |
FindByIndexOptions |
limit(java.lang.Integer limit) |
FindByIndexOptions |
readQuorum(java.lang.Integer readQuorum) |
FindByIndexOptions |
skip(java.lang.Integer skip) |
FindByIndexOptions |
sort(IndexField sort)
Can be called multiple times to set the sort syntax
|
FindByIndexOptions |
useIndex(java.lang.String designDocument)
Specify a specific index to run the query against
|
FindByIndexOptions |
useIndex(java.lang.String designDocument,
java.lang.String indexName)
Specify a specific index to run the query against
|
public FindByIndexOptions limit(java.lang.Integer limit)
limit
- limit the number of results returnpublic FindByIndexOptions skip(java.lang.Integer skip)
skip
- Skips n number of results.public FindByIndexOptions readQuorum(java.lang.Integer readQuorum)
readQuorum
- set the readQuorumpublic FindByIndexOptions sort(IndexField sort)
sort
- add a sort syntax fieldpublic FindByIndexOptions fields(java.lang.String field)
field
- set the return fieldspublic FindByIndexOptions useIndex(java.lang.String designDocument)
designDocument
- set the design document to usepublic FindByIndexOptions useIndex(java.lang.String designDocument, java.lang.String indexName)
designDocument
- set the design document to useindexName
- set the index name to usepublic java.util.List<java.lang.String> getFields()
public java.util.List<IndexField> getSort()
public java.lang.Integer getLimit()
public java.lang.Integer getSkip()
public java.lang.Integer getReadQuorum()
public java.lang.String getUseIndex()