Skip to content

Commit dcf1848

Browse files
committed
Polishing.
Add since and author tags. Update reference docs. Fix format of ticket references in tests. See #3708 Original pull request: #3796.
1 parent 59d0042 commit dcf1848

File tree

4 files changed

+25
-23
lines changed

4 files changed

+25
-23
lines changed

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

+12-6
Original file line numberDiff line numberDiff line change
@@ -739,20 +739,22 @@ public Sinh sinh(AngularUnit unit) {
739739
* Creates new {@link AggregationExpression} that calculates the inverse sine of a numeric value.
740740
*
741741
* @return new instance of {@link ASin}.
742+
* @since 3.3
742743
*/
743744
public ASin asin() {
744745
return usesFieldRef() ? ASin.asinOf(fieldReference) : ASin.asinOf(expression);
745746
}
746-
747+
747748
/**
748749
* Creates new {@link AggregationExpression} that calculates the inverse hyperbolic sine of a numeric value.
749750
*
750751
* @return new instance of {@link ASinh}.
752+
* @since 3.3
751753
*/
752754
public ASinh asinh() {
753755
return usesFieldRef() ? ASinh.asinhOf(fieldReference) : ASinh.asinhOf(expression);
754756
}
755-
757+
756758
/**
757759
* Creates new {@link AggregationExpression} that calculates the cosine of a numeric value given in
758760
* {@link AngularUnit#RADIANS radians}.
@@ -2357,10 +2359,12 @@ protected String getMongoMethod() {
23572359
return "$sinh";
23582360
}
23592361
}
2360-
2362+
23612363
/**
23622364
* An {@link AggregationExpression expression} that calculates the inverse sine of a value.
23632365
*
2366+
* @author Divya Srivastava
2367+
* @since 3.3
23642368
*/
23652369
public static class ASin extends AbstractAggregationExpression {
23662370

@@ -2407,9 +2411,12 @@ protected String getMongoMethod() {
24072411
return "$asin";
24082412
}
24092413
}
2410-
2414+
24112415
/**
24122416
* An {@link AggregationExpression expression} that calculates the inverse hyperbolic sine of a value
2417+
*
2418+
* @author Divya Srivastava
2419+
* @since 3.3
24132420
*/
24142421
public static class ASinh extends AbstractAggregationExpression {
24152422

@@ -2430,7 +2437,7 @@ public static ASinh asinhOf(String fieldReference) {
24302437
/**
24312438
* Creates a new {@link AggregationExpression} that calculates the inverse hyperbolic sine of a value.
24322439
* <p />
2433-
*
2440+
*
24342441
* @param expression the {@link AggregationExpression expression} that resolves to a numeric value.
24352442
* @return new instance of {@link ASinh}.
24362443
*/
@@ -2884,7 +2891,6 @@ public ATan2 atan2of(AggregationExpression expression) {
28842891
* @return new instance of {@link ATan2}.
28852892
*/
28862893
public ATan2 atan2of(Number value) {
2887-
28882894
return new ATan2(append(value));
28892895
}
28902896

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

+6-10
Original file line numberDiff line numberDiff line change
@@ -109,19 +109,15 @@ void rendersSinhWithValueInDegrees() {
109109
assertThat(valueOf("angle").sinh(AngularUnit.DEGREES).toDocument(Aggregation.DEFAULT_CONTEXT))
110110
.isEqualTo("{ $sinh : { $degreesToRadians : \"$angle\" } }");
111111
}
112-
113-
@Test // DATAMONGO - 3708
114-
void rendersASin() {
115112

116-
assertThat(valueOf("field").asin().toDocument(Aggregation.DEFAULT_CONTEXT))
117-
.isEqualTo("{ $asin : \"$field\" }");
113+
@Test // GH-3708
114+
void rendersASin() {
115+
assertThat(valueOf("field").asin().toDocument(Aggregation.DEFAULT_CONTEXT)).isEqualTo("{ $asin : \"$field\" }");
118116
}
119-
120-
@Test // DATAMONGO - 3708
121-
void rendersASinh() {
122117

123-
assertThat(valueOf("field").asinh().toDocument(Aggregation.DEFAULT_CONTEXT))
124-
.isEqualTo("{ $asinh : \"$field\" }");
118+
@Test // GH-3708
119+
void rendersASinh() {
120+
assertThat(valueOf("field").asinh().toDocument(Aggregation.DEFAULT_CONTEXT)).isEqualTo("{ $asinh : \"$field\" }");
125121
}
126122

127123
@Test // GH-3710

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -1078,13 +1078,13 @@ void shouldRenderSin() {
10781078
void shouldRenderSinh() {
10791079
assertThat(transform("sinh(angle)")).isEqualTo("{ \"$sinh\" : \"$angle\"}");
10801080
}
1081-
1082-
@Test // DATAMONGO-3708
1081+
1082+
@Test // GH-3708
10831083
void shouldRenderASin() {
10841084
assertThat(transform("asin(number)")).isEqualTo("{ \"$asin\" : \"$number\"}");
10851085
}
10861086

1087-
@Test // DATAMONGO-3708
1087+
@Test // GH-3708
10881088
void shouldRenderASinh() {
10891089
assertThat(transform("asinh(number)")).isEqualTo("{ \"$asinh\" : \"$number\"}");
10901090
}
@@ -1108,17 +1108,17 @@ void shouldRenderTan() {
11081108
void shouldRenderTanh() {
11091109
assertThat(transform("tanh(angle)")).isEqualTo("{ \"$tanh\" : \"$angle\"}");
11101110
}
1111-
1111+
11121112
@Test // DATAMONGO - 3709
11131113
void shouldRenderATan() {
11141114
assertThat(transform("atan(number)")).isEqualTo("{ \"$atan\" : \"$number\"}");
11151115
}
1116-
1116+
11171117
@Test // DATAMONGO - 3709
11181118
void shouldRenderATan2() {
11191119
assertThat(transform("atan2(number1,number2)")).isEqualTo("{ \"$atan2\" : [ \"$number1\" , \"$number2\" ] }");
11201120
}
1121-
1121+
11221122
@Test // DATAMONGO - 3709
11231123
void shouldRenderATanh() {
11241124
assertThat(transform("atanh(number)")).isEqualTo("{ \"$atanh\" : \"$number\"}");

src/main/asciidoc/reference/aggregation-framework.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ At the time of this writing, we provide support for the following Aggregation Op
8585
| `addToSet`, `covariancePop`, `covarianceSamp`, `expMovingAvg`, `first`, `last`, `max`, `min`, `avg`, `push`, `sum`, `count` (+++*+++), `stdDevPop`, `stdDevSamp`
8686

8787
| Arithmetic Aggregation Operators
88-
| `abs`, `add` (+++*+++ via `plus`), `atan`, `atan2`, `atanh`, `ceil`, `cos`, `cosh`, `derivative`, `divide`, `exp`, `floor`, `integral`, `ln`, `log`, `log10`, `mod`, `multiply`, `pow`, `round`, `sqrt`, `subtract` (+++*+++ via `minus`), `sin`, `sinh`, `tan`, `tanh`, `trunc`
88+
| `abs`, `add` (+++*+++ via `plus`), `asin`, `asin`, `atan`, `atan2`, `atanh`, `ceil`, `cos`, `cosh`, `derivative`, `divide`, `exp`, `floor`, `integral`, `ln`, `log`, `log10`, `mod`, `multiply`, `pow`, `round`, `sqrt`, `subtract` (+++*+++ via `minus`), `sin`, `sinh`, `tan`, `tanh`, `trunc`
8989

9090
| String Aggregation Operators
9191
| `concat`, `substr`, `toLower`, `toUpper`, `strcasecmp`, `indexOfBytes`, `indexOfCP`, `regexFind`, `regexFindAll`, `regexMatch`, `split`, `strLenBytes`, `strLenCP`, `substrCP`, `trim`, `ltrim`, `rtim`

0 commit comments

Comments
 (0)