Skip to content

Commit

Permalink
Polishing
Browse files Browse the repository at this point in the history
Update Javadoc to mention unit of measure for min/maxDistance depending on usage of geoJson.
Also remove unused imports from tests

See #4004
Original pull request: #4006.
  • Loading branch information
christophstrobl authored and mp911de committed Sep 21, 2022
1 parent c272c73 commit de33734
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Expand Up @@ -624,9 +624,13 @@ public Criteria intersects(GeoJson geoJson) {
}

/**
* Creates a geo-spatial criterion using a {@literal $maxDistance} operation, for use with $near
* Creates a geo-spatial criterion using a {@literal $maxDistance} operation, for use with {@literal $near} or
* {@literal $nearSphere}.
* <p>
* <strong>NOTE:</strong> The unit of measure for distance may depends on the used coordinate representation
* (legacy vs. geoJson) as well as the target operation.
*
* @param maxDistance
* @param maxDistance radians or meters
* @return this.
* @see <a href="https://docs.mongodb.com/manual/reference/operator/query/maxDistance/">MongoDB Query operator:
* $maxDistance</a>
Expand All @@ -645,8 +649,11 @@ public Criteria maxDistance(double maxDistance) {
/**
* Creates a geospatial criterion using a {@literal $minDistance} operation, for use with {@literal $near} or
* {@literal $nearSphere}.
* <p>
* <strong>NOTE:</strong> The unit of measure for distance may depends on the used coordinate representation
* (legacy vs. geoJson) as well as the target operation.
*
* @param minDistance
* @param minDistance radians or meters
* @return this.
* @since 1.7
*/
Expand Down
Expand Up @@ -15,17 +15,13 @@
*/
package org.springframework.data.mongodb.core;

import static org.mockito.Mockito.*;
import static org.springframework.data.mongodb.core.query.Criteria.*;
import static org.springframework.data.mongodb.core.query.Query.*;
import static org.springframework.data.mongodb.test.util.Assertions.*;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import org.springframework.data.geo.Point;
import org.springframework.data.mongodb.MongoDatabaseFactory;
import org.springframework.data.mongodb.core.convert.DefaultDbRefResolver;
import org.springframework.data.mongodb.core.convert.MappingMongoConverter;
import org.springframework.data.mongodb.core.convert.NoOpDbRefResolver;
import org.springframework.data.mongodb.core.convert.QueryMapper;
Expand Down

0 comments on commit de33734

Please sign in to comment.