You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Skip output for void methods using declarative Aggregations having $out stage.
We now set the skipOutput flag if an annotated Aggregation defines an $out stage and when the method is declared to return no result (void / Mono<Void>, kotlin.Unit)
Closes: #4088
Original pull request: #4341
Copy file name to clipboardExpand all lines: spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/AbstractMongoQuery.java
+1
Original file line number
Diff line number
Diff line change
@@ -127,6 +127,7 @@ public Object execute(Object[] parameters) {
127
127
* @param accessor for providing invocation arguments. Never {@literal null}.
128
128
* @param typeToRead the desired component target type. Can be {@literal null}.
Copy file name to clipboardExpand all lines: spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/MongoQueryExecution.java
Copy file name to clipboardExpand all lines: spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/ReactiveStringBasedAggregation.java
Copy file name to clipboardExpand all lines: spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/StringBasedAggregation.java
Copy file name to clipboardExpand all lines: spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/query/ReactiveStringBasedAggregationUnitTests.java
+28
Original file line number
Diff line number
Diff line change
@@ -78,6 +78,7 @@ public class ReactiveStringBasedAggregationUnitTests {
Copy file name to clipboardExpand all lines: spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/query/StringBasedAggregationUnitTests.java
+28
Original file line number
Diff line number
Diff line change
@@ -91,6 +91,7 @@ public class StringBasedAggregationUnitTests {
@@ -75,6 +81,7 @@ Therefore, the `Sort` properties are mapped against the methods return type `Per
75
81
To gain more control, you might consider `AggregationResult` as method return type as shown in <7>.
76
82
<8> Obtain the raw `AggregationResults` mapped to the generic target wrapper type `SumValue` or `org.bson.Document`.
77
83
<9> Like in <6>, a single value can be directly obtained from multiple result ``Document``s.
84
+
<10> Skips the output of the `$out` stage when return type is `void`.
78
85
====
79
86
80
87
In some scenarios, aggregations might require additional options, such as a maximum run time, additional log comments, or the permission to temporarily write data to disk.
0 commit comments