diff --git a/pom.xml b/pom.xml index c3245aad49..5eae564e30 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.data spring-data-mongodb-parent - 4.5.0-SNAPSHOT + 4.5.0-GH-4852-SNAPSHOT pom Spring Data MongoDB diff --git a/spring-data-mongodb-distribution/pom.xml b/spring-data-mongodb-distribution/pom.xml index 58c63dfc97..8473836708 100644 --- a/spring-data-mongodb-distribution/pom.xml +++ b/spring-data-mongodb-distribution/pom.xml @@ -15,7 +15,7 @@ org.springframework.data spring-data-mongodb-parent - 4.5.0-SNAPSHOT + 4.5.0-GH-4852-SNAPSHOT ../pom.xml diff --git a/spring-data-mongodb/pom.xml b/spring-data-mongodb/pom.xml index 98516a5ba9..94b1c103a0 100644 --- a/spring-data-mongodb/pom.xml +++ b/spring-data-mongodb/pom.xml @@ -13,7 +13,7 @@ org.springframework.data spring-data-mongodb-parent - 4.5.0-SNAPSHOT + 4.5.0-GH-4852-SNAPSHOT ../pom.xml diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/Meta.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/Meta.java index 33aa7c80e4..74a7f8fd66 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/Meta.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/Meta.java @@ -24,6 +24,12 @@ import org.springframework.data.annotation.QueryAnnotation; /** + * Annotation to declare meta-information (execution time, cursor size, disk usage) for query methods. + *

+ * Annotating a repository method with this annotation forces the method to be implemented as query method (i.e. using + * this annotation on an overridden method from a base interface or fragment interface), similar to using + * {@link Query @Query}. + * * @author Christoph Strobl * @author Mark Paluch * @since 1.6 diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/Near.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/Near.java index c18c1efbe7..fb2914eaef 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/Near.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/Near.java @@ -25,8 +25,8 @@ import org.springframework.data.geo.Point; /** - * Annotation to be used for disambiguing method parameters that shall be used to trigger geo near queries. By default - * those parameters are found without the need for additional annotation if they are the only parameters of the + * Annotation to be used for disambiguating method parameters that shall be used to trigger geo near queries. By + * default, those parameters are found without the need for additional annotation if they are the only parameters of the * according type (e.g. {@link Point}, {@code double[]}, {@link Distance}). * * @author Oliver Gierke diff --git a/src/main/antora/modules/ROOT/pages/mongodb/repositories/query-methods.adoc b/src/main/antora/modules/ROOT/pages/mongodb/repositories/query-methods.adoc index adb2392f04..7811eb97e0 100644 --- a/src/main/antora/modules/ROOT/pages/mongodb/repositories/query-methods.adoc +++ b/src/main/antora/modules/ROOT/pages/mongodb/repositories/query-methods.adoc @@ -205,6 +205,9 @@ lower / upper bounds (`$gt` / `$gte` & `$lt` / `$lte`) according to `Range` NOTE: If the property criterion compares a document, the order of the fields and exact equality in the document matters. +NOTE: In some scenarios, you might require additional options, such as a maximum run time, additional log comments, or the permission to temporarily write data to disk. +Use the `@Meta` annotation to set those options via `maxExecutionTimeMs`, `comment` or `allowDiskUse`. `@Meta` can only be used on repository query methods, not on base interface or fragment interface methods. + [[mongodb.repositories.queries.geo-spatial]] == Geo-spatial Queries @@ -419,7 +422,7 @@ public interface PersonRepository extends ReactiveMongoRepository