@ -147,87 +147,87 @@ The first method shows a query for all people with the given lastname. The query
@@ -147,87 +147,87 @@ The first method shows a query for all people with the given lastname. The query
NOTE: Note that for version 1.0 we currently don't support referring to parameters that are mapped as `DBRef` in the domain class.
[cols="1,2,3", options="header"]
[cols="1,2,3", options="header"]
.Supported keywords for query methods
|===
| Keyword
| Sample
| Sample
| Logical result
| `GreaterThan`
| `findByAgeGreaterThan(int age)`
| `GreaterThan`
| `findByAgeGreaterThan(int age)`
| `{"age" : {"$gt" : age}}`
| `GreaterThanEqual`
| `findByAgeGreaterThanEqual(int age)`
| `GreaterThanEqual`
| `findByAgeGreaterThanEqual(int age)`
| `{"age" : {"$gte" : age}}`
| `LessThan`
| `findByAgeLessThan(int age)`
| `LessThan`
| `findByAgeLessThan(int age)`
| `{"age" : {"$lt" : age}}`
| `LessThanEqual`
| `findByAgeLessThanEqual(int age)`
| `LessThanEqual`
| `findByAgeLessThanEqual(int age)`
| `{"age" : {"$lte" : age}}`
| `Between`
| `findByAgeBetween(int from, int to)`
| `Between`
| `findByAgeBetween(int from, int to)`
| `{"age" : {"$gt" : from, "$lt" : to}}`
| `In`
| `In`
| `findByAgeIn(Collection ages)`
| `{"age" : {"$in" : [ages...]}}`
| `NotIn`
| `findByAgeNotIn(Collection ages)`
| `NotIn`
| `findByAgeNotIn(Collection ages)`
| `{"age" : {"$nin" : [ages...]}}`
| `IsNotNull, NotNull`
| `findByFirstnameNotNull()`
| `{"ag e" : {"$ne" : null}}`
| `IsNotNull, NotNull`
| `findByFirstnameNotNull()`
| `{"firstnam e" : {"$ne" : null}}`
| `IsNull, Null`
| `findByFirstnameNull()`
| `{"ag e" : null}`
| `IsNull, Null`
| `findByFirstnameNull()`
| `{"firstnam e" : null}`
| `Like`
| `Like`
| `findByFirstnameLike(String name)`
| `{"age" : age} ( ag e as regex)`
| `{"firstname" : name} ( nam e as regex)`
| `Regex`
| `findByFirstnameRegex(String firstname)`
| `Regex`
| `findByFirstnameRegex(String firstname)`
| `{"firstname" : {"$regex" : firstname }}`
| `(No keyword)`
| `(No keyword)`
| `findByFirstname(String name)`
| `{"ag e" : name}`
| `{"firstnam e" : name}`
| `Not`
| `findByFirstnameNot(String name)`
| `{"ag e" : {"$ne" : name}}`
| `Not`
| `findByFirstnameNot(String name)`
| `{"firstnam e" : {"$ne" : name}}`
| `Near`
| `findByLocationNear(Point point)`
| `Near`
| `findByLocationNear(Point point)`
| `{"location" : {"$near" : [x,y]}}`
| `Within`
| `findByLocationWithin(Circle circle)`
| `Within`
| `findByLocationWithin(Circle circle)`
| `{"location" : {"$within" : {"$center" : [ [x, y], distance]}}}`
| `Within`
| `findByLocationWithin(Box box)`
| `Within`
| `findByLocationWithin(Box box)`
| `{"location" : {"$within" : {"$box" : [ [x1, y1], x2, y2]}}}True`
| `IsTrue, True`
| `findByActiveIsTrue()`
| `IsTrue, True`
| `findByActiveIsTrue()`
| `{"active" : true}`
| `IsFalse, False`
| `findByActiveIsFalse()`
| `IsFalse, False`
| `findByActiveIsFalse()`
| `{"active" : false}`
| `Exists`
| `findByLocationExists(boolean exists)`
| `Exists`
| `findByLocationExists(boolean exists)`
| `{"location" : {"$exists" : exists }}`
|===
@ -463,4 +463,4 @@ class RepositoryClient {
@@ -463,4 +463,4 @@ class RepositoryClient {
List<Person> people = repository.findAll();
}
}
----
----