|
|
|
@ -160,7 +160,7 @@ The following example shows how to define a `near` query that finds all persons |
|
|
|
==== |
|
|
|
==== |
|
|
|
[source,java] |
|
|
|
[source,java] |
|
|
|
---- |
|
|
|
---- |
|
|
|
public interface PersonRepository extends ReactiveMongoRepository<Person, String> |
|
|
|
public interface PersonRepository extends ReactiveMongoRepository<Person, String> { |
|
|
|
|
|
|
|
|
|
|
|
// { 'location' : { '$near' : [point.x, point.y], '$maxDistance' : distance}} |
|
|
|
// { 'location' : { '$near' : [point.x, point.y], '$maxDistance' : distance}} |
|
|
|
Flux<Person> findByLocationNear(Point location, Distance distance); |
|
|
|
Flux<Person> findByLocationNear(Point location, Distance distance); |
|
|
|
@ -195,7 +195,7 @@ Spring Data MongoDB supports geo-near queries, as the following example shows: |
|
|
|
|
|
|
|
|
|
|
|
[source,java] |
|
|
|
[source,java] |
|
|
|
---- |
|
|
|
---- |
|
|
|
public interface PersonRepository extends ReactiveMongoRepository<Person, String> |
|
|
|
public interface PersonRepository extends ReactiveMongoRepository<Person, String> { |
|
|
|
|
|
|
|
|
|
|
|
// {'geoNear' : 'location', 'near' : [x, y] } |
|
|
|
// {'geoNear' : 'location', 'near' : [x, y] } |
|
|
|
Flux<GeoResult<Person>> findByLocationNear(Point location); |
|
|
|
Flux<GeoResult<Person>> findByLocationNear(Point location); |
|
|
|
|