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 66c9bd786..3b90056dc 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 java.lang.annotation.Target; 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 f0da9965a..68ba73834 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.Distance; 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 8ae506515..67ccb94e5 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 @@ -443,7 +446,7 @@ public interface PersonRepository extends ReactiveMongoRepository