@Retention(value=RUNTIME) @Target(value={METHOD,ANNOTATION_TYPE}) @Documented public @interface Query
?0
, ?1
and so on.Modifier and Type | Optional Element and Description |
---|---|
boolean |
count
Returns whether the query defined should be executed as count projection.
|
boolean |
delete
Returns whether the query should delete matching documents.
|
boolean |
exists
Returns whether the query defined should be executed as exists projection.
|
String |
fields
Defines the fields that should be returned for the given query.
|
String |
sort
Defines a default sort order for the given query.
|
String |
value
Takes a MongoDB JSON string to define the actual query to be executed.
|
public abstract String value
public abstract String fields
public abstract boolean count
public abstract boolean exists
public abstract boolean delete
public abstract String sort
Sort
argument of the query method.
@Query(sort = "{ age : -1 }") // order by age descending
List findByFirstname(String firstname);
Copyright © 2011–2019 Pivotal Software, Inc.. All rights reserved.