Browse Source

DATACMNS-1132 - Fixed keyword translation table in the reference documentation.

Original pull request: #262.
pull/263/head
Christophe Fargette 11 years ago committed by Oliver Gierke
parent
commit
1c2964cab4
  1. 86
      src/main/asciidoc/reference/mongo-repositories.adoc

86
src/main/asciidoc/reference/mongo-repositories.adoc

@ -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. 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 .Supported keywords for query methods
|=== |===
| Keyword | Keyword
| Sample | Sample
| Logical result | Logical result
| `GreaterThan` | `GreaterThan`
| `findByAgeGreaterThan(int age)` | `findByAgeGreaterThan(int age)`
| `{"age" : {"$gt" : age}}` | `{"age" : {"$gt" : age}}`
| `GreaterThanEqual` | `GreaterThanEqual`
| `findByAgeGreaterThanEqual(int age)` | `findByAgeGreaterThanEqual(int age)`
| `{"age" : {"$gte" : age}}` | `{"age" : {"$gte" : age}}`
| `LessThan` | `LessThan`
| `findByAgeLessThan(int age)` | `findByAgeLessThan(int age)`
| `{"age" : {"$lt" : age}}` | `{"age" : {"$lt" : age}}`
| `LessThanEqual` | `LessThanEqual`
| `findByAgeLessThanEqual(int age)` | `findByAgeLessThanEqual(int age)`
| `{"age" : {"$lte" : age}}` | `{"age" : {"$lte" : age}}`
| `Between` | `Between`
| `findByAgeBetween(int from, int to)` | `findByAgeBetween(int from, int to)`
| `{"age" : {"$gt" : from, "$lt" : to}}` | `{"age" : {"$gt" : from, "$lt" : to}}`
| `In` | `In`
| `findByAgeIn(Collection ages)` | `findByAgeIn(Collection ages)`
| `{"age" : {"$in" : [ages...]}}` | `{"age" : {"$in" : [ages...]}}`
| `NotIn` | `NotIn`
| `findByAgeNotIn(Collection ages)` | `findByAgeNotIn(Collection ages)`
| `{"age" : {"$nin" : [ages...]}}` | `{"age" : {"$nin" : [ages...]}}`
| `IsNotNull, NotNull` | `IsNotNull, NotNull`
| `findByFirstnameNotNull()` | `findByFirstnameNotNull()`
| `{"age" : {"$ne" : null}}` | `{"firstname" : {"$ne" : null}}`
| `IsNull, Null` | `IsNull, Null`
| `findByFirstnameNull()` | `findByFirstnameNull()`
| `{"age" : null}` | `{"firstname" : null}`
| `Like` | `Like`
| `findByFirstnameLike(String name)` | `findByFirstnameLike(String name)`
| `{"age" : age} ( age as regex)` | `{"firstname" : name} ( name as regex)`
| `Regex` | `Regex`
| `findByFirstnameRegex(String firstname)` | `findByFirstnameRegex(String firstname)`
| `{"firstname" : {"$regex" : firstname }}` | `{"firstname" : {"$regex" : firstname }}`
| `(No keyword)` | `(No keyword)`
| `findByFirstname(String name)` | `findByFirstname(String name)`
| `{"age" : name}` | `{"firstname" : name}`
| `Not` | `Not`
| `findByFirstnameNot(String name)` | `findByFirstnameNot(String name)`
| `{"age" : {"$ne" : name}}` | `{"firstname" : {"$ne" : name}}`
| `Near` | `Near`
| `findByLocationNear(Point point)` | `findByLocationNear(Point point)`
| `{"location" : {"$near" : [x,y]}}` | `{"location" : {"$near" : [x,y]}}`
| `Within` | `Within`
| `findByLocationWithin(Circle circle)` | `findByLocationWithin(Circle circle)`
| `{"location" : {"$within" : {"$center" : [ [x, y], distance]}}}` | `{"location" : {"$within" : {"$center" : [ [x, y], distance]}}}`
| `Within` | `Within`
| `findByLocationWithin(Box box)` | `findByLocationWithin(Box box)`
| `{"location" : {"$within" : {"$box" : [ [x1, y1], x2, y2]}}}True` | `{"location" : {"$within" : {"$box" : [ [x1, y1], x2, y2]}}}True`
| `IsTrue, True` | `IsTrue, True`
| `findByActiveIsTrue()` | `findByActiveIsTrue()`
| `{"active" : true}` | `{"active" : true}`
| `IsFalse, False` | `IsFalse, False`
| `findByActiveIsFalse()` | `findByActiveIsFalse()`
| `{"active" : false}` | `{"active" : false}`
| `Exists` | `Exists`
| `findByLocationExists(boolean exists)` | `findByLocationExists(boolean exists)`
| `{"location" : {"$exists" : exists }}` | `{"location" : {"$exists" : exists }}`
|=== |===
@ -463,4 +463,4 @@ class RepositoryClient {
List<Person> people = repository.findAll(); List<Person> people = repository.findAll();
} }
} }
---- ----

Loading…
Cancel
Save