-
Notifications
You must be signed in to change notification settings - Fork 1.1k
DATAMONGO-1110 - Add support for $minDistance. #277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8334e00
to
e8f4288
Compare
odrotbohm
added a commit
that referenced
this pull request
Mar 4, 2015
Moved to newly introduced Range type in Spring Data Commons to more safely bind minimum and maximum distances. Changed internal APIs to always use a Range<Distance> which gets populated based on the method signature's characteristics: if only one Distance parameter is found it's interpreted as a range with upper bound only. Original pull request: #277.
e8f4288
to
155a53a
Compare
odrotbohm
added a commit
that referenced
this pull request
Mar 5, 2015
Moved to newly introduced Range type in Spring Data Commons to more safely bind minimum and maximum distances. Changed internal APIs to always use a Range<Distance> which gets populated based on the method signature's characteristics: if only one Distance parameter is found it's interpreted as a range with upper bound only. Original pull request: #277.
155a53a
to
e493adc
Compare
odrotbohm
added a commit
that referenced
this pull request
Mar 5, 2015
Moved to newly introduced Range type in Spring Data Commons to more safely bind minimum and maximum distances. Changed internal APIs to always use a Range<Distance> which gets populated based on the method signature's characteristics: if only one Distance parameter is found it's interpreted as a range with upper bound only. Original pull request: #277.
e493adc
to
f010ab7
Compare
odrotbohm
added a commit
that referenced
this pull request
Mar 5, 2015
Moved to newly introduced Range type in Spring Data Commons to more safely bind minimum and maximum distances. Changed internal APIs to always use a Range<Distance> which gets populated based on the method signature's characteristics: if only one Distance parameter is found it's interpreted as a range with upper bound only. Removed invalid testcase for minDistance on 2d index. Original pull request: #277.
Prepare issue branch.
We now support $minDistance for NearQuery and Criteria. Please keep in mind that minDistance is only available for MongoDB 2.6 and better and can only be combined with $near or $nearSphere operator depending on the defined index type. Usage of $minDistance with NearQuery is only possible when a 2dsphere index is present.
It is now possible to use two distance parameter within the repository queries. This allows to define near queries like: findByLocationNear(Point point, Distance min, Distance max); Please note that the first distance parameter is treated as the minimum distance while the second one defines the maximum distance from the given point, while the distance parameter will server as maxDistance in case only one Distance is provided.
Moved to newly introduced Range type in Spring Data Commons to more safely bind minimum and maximum distances. Changed internal APIs to always use a Range<Distance> which gets populated based on the method signature's characteristics: if only one Distance parameter is found it's interpreted as a range with upper bound only. Removed invalid testcase for minDistance on 2d index. Original pull request: #277.
We now make sure $minDistance operator gets correctly nested when using GeoJSON types. Original pull request: #277.
f010ab7
to
34329bc
Compare
christophstrobl
added a commit
that referenced
this pull request
Mar 5, 2015
We now support $minDistance for NearQuery and Criteria. Please keep in mind that minDistance is only available for MongoDB 2.6 and better and can only be combined with $near or $nearSphere operator depending on the defined index type. Usage of $minDistance with NearQuery is only possible when a 2dsphere index is present. We also make sure $minDistance operator gets correctly nested when using GeoJSON types. It is now possible to use a Range<Distance> parameter within the repository queries. This allows to define near queries like: findByLocationNear(Point point, Range<Distance> distances); The lower bound of the range is treated as the minimum distance while the upper one defines the maximum distance from the given point. In case a Distance parameter is provided it will serve as maxDistance. Original pull request: #277.
odrotbohm
added a commit
that referenced
this pull request
Mar 5, 2015
Moved to newly introduced Range type in Spring Data Commons to more safely bind minimum and maximum distances. Changed internal APIs to always use a Range<Distance> which gets populated based on the method signature's characteristics: if only one Distance parameter is found it's interpreted as a range with upper bound only. Removed invalid testcase for minDistance on 2D index. Original pull request: #277.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We now support
$minDistance
forNearQuery
andCriteria
. Please keep in mind that$minDistance
is only available for MongoDB 2.6 and better and can only be combined with$near
or$nearSphere
operator depending on the defined index type. Usage of$minDistance
withNearQuery
is only possible when a2dsphere
index is present.Further on query derivation now allows a 2nd
Distance
parameter for thenear
keyword. This allows to define near queries like:The first
Distance
parameter is treated as the minimum distance while the second one defines the maximum distance from the given point, while the distance parameter will server as maximum distance in case only oneDistance
parameter is provided.