@@ -370,7 +370,7 @@ infix fun KProperty<GeoJson<*>>.minDistance(d: Double): Criteria =
|
|||||||
* See [MongoDB Query operator:
|
* See [MongoDB Query operator:
|
||||||
* $maxDistance](https://docs.mongodb.com/manual/reference/operator/query/maxDistance/)
|
* $maxDistance](https://docs.mongodb.com/manual/reference/operator/query/maxDistance/)
|
||||||
* @author Sangyong Choi
|
* @author Sangyong Choi
|
||||||
* @since 3.2
|
* @since 3.2.5
|
||||||
* @see Criteria.maxDistance
|
* @see Criteria.maxDistance
|
||||||
*/
|
*/
|
||||||
infix fun Criteria.maxDistance(d: Double): Criteria =
|
infix fun Criteria.maxDistance(d: Double): Criteria =
|
||||||
@@ -380,7 +380,7 @@ infix fun Criteria.maxDistance(d: Double): Criteria =
|
|||||||
* Creates a geospatial criterion using a $minDistance operation, for use with $near or
|
* Creates a geospatial criterion using a $minDistance operation, for use with $near or
|
||||||
* $nearSphere.
|
* $nearSphere.
|
||||||
* @author Sangyong Choi
|
* @author Sangyong Choi
|
||||||
* @since 3.2
|
* @since 3.2.5
|
||||||
* @see Criteria.minDistance
|
* @see Criteria.minDistance
|
||||||
*/
|
*/
|
||||||
infix fun Criteria.minDistance(d: Double): Criteria =
|
infix fun Criteria.minDistance(d: Double): Criteria =
|
||||||
|
|||||||
@@ -25,8 +25,11 @@ import org.springframework.data.mongodb.core.schema.JsonSchemaObject.Type
|
|||||||
import java.util.regex.Pattern
|
import java.util.regex.Pattern
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Unit tests for [Criteria] extensions.
|
||||||
|
*
|
||||||
* @author Tjeu Kayim
|
* @author Tjeu Kayim
|
||||||
* @author Mark Paluch
|
* @author Mark Paluch
|
||||||
|
* @author Sangyong Choi
|
||||||
*/
|
*/
|
||||||
class TypedCriteriaExtensionsTests {
|
class TypedCriteriaExtensionsTests {
|
||||||
|
|
||||||
@@ -319,8 +322,8 @@ class TypedCriteriaExtensionsTests {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `maxDistance() should equal expected criteria with nearSphere`() {
|
fun `maxDistance() should equal expected criteria with nearSphere`() {
|
||||||
val point = Point(0.0, 0.0)
|
|
||||||
|
|
||||||
|
val point = Point(0.0, 0.0)
|
||||||
val typed = Building::location nearSphere point maxDistance 3.0
|
val typed = Building::location nearSphere point maxDistance 3.0
|
||||||
val expected = Criteria("location")
|
val expected = Criteria("location")
|
||||||
.nearSphere(point)
|
.nearSphere(point)
|
||||||
@@ -331,8 +334,8 @@ class TypedCriteriaExtensionsTests {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `minDistance() should equal expected criteria with nearSphere`() {
|
fun `minDistance() should equal expected criteria with nearSphere`() {
|
||||||
val point = Point(0.0, 0.0)
|
|
||||||
|
|
||||||
|
val point = Point(0.0, 0.0)
|
||||||
val typed = Building::location nearSphere point minDistance 3.0
|
val typed = Building::location nearSphere point minDistance 3.0
|
||||||
val expected = Criteria("location")
|
val expected = Criteria("location")
|
||||||
.nearSphere(point)
|
.nearSphere(point)
|
||||||
@@ -343,8 +346,8 @@ class TypedCriteriaExtensionsTests {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `maxDistance() should equal expected criteria with near`() {
|
fun `maxDistance() should equal expected criteria with near`() {
|
||||||
val point = Point(0.0, 0.0)
|
|
||||||
|
|
||||||
|
val point = Point(0.0, 0.0)
|
||||||
val typed = Building::location near point maxDistance 3.0
|
val typed = Building::location near point maxDistance 3.0
|
||||||
val expected = Criteria("location")
|
val expected = Criteria("location")
|
||||||
.near(point)
|
.near(point)
|
||||||
@@ -355,8 +358,8 @@ class TypedCriteriaExtensionsTests {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `minDistance() should equal expected criteria with near`() {
|
fun `minDistance() should equal expected criteria with near`() {
|
||||||
val point = Point(0.0, 0.0)
|
|
||||||
|
|
||||||
|
val point = Point(0.0, 0.0)
|
||||||
val typed = Building::location near point minDistance 3.0
|
val typed = Building::location near point minDistance 3.0
|
||||||
val expected = Criteria("location")
|
val expected = Criteria("location")
|
||||||
.near(point)
|
.near(point)
|
||||||
|
|||||||
Reference in New Issue
Block a user