Reorder methods. Tweak Javadoc and documentation wording. Mention projection expressions in the what's new section. Reformat code.
See #3583
Original pull request: #3585.
@ -49,11 +51,9 @@ public class BindableMongoExpression implements MongoExpression {
@@ -49,11 +51,9 @@ public class BindableMongoExpression implements MongoExpression {
@ -118,16 +118,8 @@ public class BindableMongoExpression implements MongoExpression {
@@ -118,16 +118,8 @@ public class BindableMongoExpression implements MongoExpression {
@ -148,4 +140,13 @@ public class BindableMongoExpression implements MongoExpression {
@@ -148,4 +140,13 @@ public class BindableMongoExpression implements MongoExpression {
@ -1251,7 +1251,7 @@ The `Query` class has some additional methods that provide options for the query
@@ -1251,7 +1251,7 @@ The `Query` class has some additional methods that provide options for the query
==== Selecting fields
MongoDB supports https://docs.mongodb.com/manual/tutorial/project-fields-from-query-results/[projecting fields] returned by a query.
A projection can in- & exclude fields (the `_id` field is always included unless explicitly excluded) based on their name.
A projection can include and exclude fields (the `_id` field is always included unless explicitly excluded) based on their name.
.Selecting result fields
====
@ -1268,13 +1268,13 @@ public class Person {
@@ -1268,13 +1268,13 @@ public class Person {
<1> Use a native expression. The used field names must refer to the ones of the document within the database.
<2> Assign the field name that shall hold the expression result in the target document. The resulting field name will never be mapped against the domain model.
<1> Use a native expression. The used field name must refer to field names within the database document.
<2> Assign the field name to which the expression result is projected. The resulting field name is not mapped against the domain model.
<3> Use an `AggregationExpression`. Other than native `MongoExpression`, field names are mapped to the ones used in the domain model.
<4> Use SpEL along with an `AggregationExpression` to invoke expression functions. Field names are mapped to the ones used in the domain model.
====
`@Query(fields='...')` allows usage of expression field projections at `Repository` level as described in <<mongodb.repositories.queries.json-based>>.
`@Query(fields="…")` allows usage of expression field projections at `Repository` level as described in <<mongodb.repositories.queries.json-based>>.