Skip to content

Commit b0ce79f

Browse files
committed
Document usage scope and effects of Meta annotation.
1 parent f421ed6 commit b0ce79f

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/Meta.java

+6
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@
2424
import org.springframework.data.annotation.QueryAnnotation;
2525

2626
/**
27+
* Annotation to declare meta-information (execution time, cursor size, disk usage) for query methods.
28+
* <p>
29+
* Annotating a repository method with this annotation forces the method to be implemented as query method (i.e. using
30+
* this annotation on an overridden method from a base interface or fragment interface), similar to using
31+
* {@link Query @Query}.
32+
*
2733
* @author Christoph Strobl
2834
* @author Mark Paluch
2935
* @since 1.6

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/Near.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
import org.springframework.data.geo.Point;
2626

2727
/**
28-
* Annotation to be used for disambiguing method parameters that shall be used to trigger geo near queries. By default
29-
* those parameters are found without the need for additional annotation if they are the only parameters of the
28+
* Annotation to be used for disambiguating method parameters that shall be used to trigger geo near queries. By
29+
* default, those parameters are found without the need for additional annotation if they are the only parameters of the
3030
* according type (e.g. {@link Point}, {@code double[]}, {@link Distance}).
3131
*
3232
* @author Oliver Gierke

src/main/antora/modules/ROOT/pages/mongodb/repositories/query-methods.adoc

+4-1
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,9 @@ lower / upper bounds (`$gt` / `$gte` & `$lt` / `$lte`) according to `Range`
205205

206206
NOTE: If the property criterion compares a document, the order of the fields and exact equality in the document matters.
207207

208+
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.
209+
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.
210+
208211
[[mongodb.repositories.queries.geo-spatial]]
209212
== Geo-spatial Queries
210213

@@ -419,7 +422,7 @@ public interface PersonRepository extends ReactiveMongoRepository<Person, String
419422
======
420423

421424
Expressions can be used to invoke functions, evaluate conditionals, and construct values.
422-
SpEL expressions used in conjunction with JSON reveal a side-effect, because Map-like declarations inside of SpEL read like JSON, as the following example shows:
425+
SpEL expressions used in conjunction with JSON reveal a side effect, because Map-like declarations inside of SpEL read like JSON, as the following example shows:
423426

424427
[tabs]
425428
======

0 commit comments

Comments
 (0)