Skip to content

Commit cd4e406

Browse files
committed
DATAMONGO-2370 - Polishing.
Align since version to 2.3 until we have an indication for a major version bump. Tweak docs. Original pull request: #803.
1 parent 9f4872d commit cd4e406

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ArithmeticOperators.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ public StdDevSamp stdDevSamp() {
516516
* place.
517517
*
518518
* @return new instance of {@link Round}.
519-
* @since 3.0
519+
* @since 2.3
520520
*/
521521
public Round round() {
522522
return usesFieldRef() ? Round.roundValueOf(fieldReference) : Round.roundValueOf(expression);
@@ -526,7 +526,7 @@ public Round round() {
526526
* Creates new {@link AggregationExpression} that rounds a number to a specified decimal place.
527527
*
528528
* @return new instance of {@link Round}.
529-
* @since 3.0
529+
* @since 2.3
530530
*/
531531
public Round roundToPlace(int place) {
532532
return round().place(place);
@@ -1445,7 +1445,7 @@ public static Trunc truncValueOf(Number value) {
14451445
}
14461446

14471447
/**
1448-
* {@link Round} rounds a number to a whole integer or to a specified decimal place. <br />
1448+
* {@link Round} rounds a number to a whole integer or to a specified decimal place.
14491449
* <ul>
14501450
* <li>If {@link Round#place(int)} resolves to a positive integer, {@code $round} rounds to the given decimal
14511451
* places.</li>
@@ -1455,7 +1455,7 @@ public static Trunc truncValueOf(Number value) {
14551455
* decimal.</li>
14561456
* </ul>
14571457
*
1458-
* @since 3.0
1458+
* @since 2.3
14591459
*/
14601460
public static class Round extends AbstractAggregationExpression {
14611461

spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/ArithmeticOperatorsUnitTests.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@
2525
import org.junit.jupiter.api.Test;
2626

2727
/**
28+
* Unit tests for {@link Round}.
29+
*
2830
* @author Christoph Strobl
2931
*/
30-
3132
public class ArithmeticOperatorsUnitTests {
3233

3334
@Test // DATAMONGO-2370
@@ -41,7 +42,7 @@ void roundShouldWithoutPlace() {
4142
void roundShouldWithPlace() {
4243

4344
assertThat(valueOf("field").roundToPlace(3).toDocument(Aggregation.DEFAULT_CONTEXT))
44-
.isEqualTo(new Document("$round", Arrays.asList("$field", Integer.valueOf(3))));
45+
.isEqualTo(new Document("$round", Arrays.asList("$field", 3)));
4546
}
4647

4748
@Test // DATAMONGO-2370

src/main/asciidoc/reference/mongodb.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2516,7 +2516,7 @@ At the time of this writing, we provide support for the following Aggregation Op
25162516
| `addToSet`, `first`, `last`, `max`, `min`, `avg`, `push`, `sum`, `(*count)`, `stdDevPop`, `stdDevSamp`
25172517

25182518
| Arithmetic Aggregation Operators
2519-
| `abs`, `add` (*via `plus`), `ceil`, `divide`, `exp`, `floor`, `ln`, `log`, `log10`, `mod`, `multiply`, `pow`, `sqrt`, `subtract` (*via `minus`), `trunc`, `round`
2519+
| `abs`, `add` (*via `plus`), `ceil`, `divide`, `exp`, `floor`, `ln`, `log`, `log10`, `mod`, `multiply`, `pow`, `round`, `sqrt`, `subtract` (*via `minus`), `trunc`
25202520

25212521
| String Aggregation Operators
25222522
| `concat`, `substr`, `toLower`, `toUpper`, `stcasecmp`, `indexOfBytes`, `indexOfCP`, `split`, `strLenBytes`, `strLenCP`, `substrCP`, `trim`, `ltrim`, `rtim`

0 commit comments

Comments
 (0)