Skip to content
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

Document usage scope and effects of Meta annotation #4854

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@

<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb-parent</artifactId>
<version>4.5.0-SNAPSHOT</version>
<version>4.5.0-GH-4852-SNAPSHOT</version>
<packaging>pom</packaging>

<name>Spring Data MongoDB</name>
2 changes: 1 addition & 1 deletion spring-data-mongodb-distribution/pom.xml
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@
<parent>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb-parent</artifactId>
<version>4.5.0-SNAPSHOT</version>
<version>4.5.0-GH-4852-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

2 changes: 1 addition & 1 deletion spring-data-mongodb/pom.xml
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
<parent>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb-parent</artifactId>
<version>4.5.0-SNAPSHOT</version>
<version>4.5.0-GH-4852-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Original file line number Diff line number Diff line change
@@ -24,6 +24,12 @@
import org.springframework.data.annotation.QueryAnnotation;

/**
* Annotation to declare meta-information (execution time, cursor size, disk usage) for query methods.
* <p>
* 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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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<Person, String
======

Expressions can be used to invoke functions, evaluate conditionals, and construct values.
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:
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:

[tabs]
======