@@ -53,7 +53,7 @@ string field called ``name``:
53
53
54
54
.. code-block:: java
55
55
:copyable: true
56
-
56
+
57
57
current().getString("name")
58
58
59
59
To specify a value in an operation, pass it to the ``of()`` constructor method to
@@ -62,7 +62,7 @@ value of ``1.0``:
62
62
63
63
.. code-block:: java
64
64
:copyable: true
65
-
65
+
66
66
of(1.0)
67
67
68
68
To create an operation, chain a method to your field or value reference.
@@ -73,7 +73,7 @@ Mexico who have visited the doctor’s office at least once. The operation
73
73
performs the following actions:
74
74
75
75
- Checks if the size of the ``visitDates`` array is greater than ``0``
76
- by using the ``gt()`` method
76
+ by using the ``gt()`` method
77
77
- Checks if the ``state`` field value is “New Mexico” by using the
78
78
``eq()`` method
79
79
@@ -82,7 +82,7 @@ matches only documents that meet both criteria.
82
82
83
83
.. code-block:: java
84
84
:copyable: true
85
-
85
+
86
86
current()
87
87
.getArray("visitDates")
88
88
.size()
@@ -155,7 +155,7 @@ expressions.
155
155
156
156
* - `ofEntry() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValues.html#ofEntry(com.mongodb.client.model.mql.MqlString,T)>`__
157
157
- Returns an entry value.
158
-
158
+
159
159
* - `ofMap() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValues.html#ofMap()>`__
160
160
- Returns an empty map value.
161
161
@@ -391,7 +391,7 @@ with ``lt()``. The ``project()`` method stores these filtered results as a new
391
391
You must specify the type of the array that you retrieve with the
392
392
``getArray()`` method if you need to work with the values of the
393
393
array as their specific type.
394
-
394
+
395
395
In this example, we specify that the ``seats`` array contains values
396
396
of type ``MqlDocument`` so that we can extract nested fields from
397
397
each array entry.
@@ -433,7 +433,7 @@ the Query API:
433
433
input: "$showtimes",
434
434
as: "showtime",
435
435
cond: { $lt: [ "$$showtime.ticketsBought", { $sum: "$$showtime.seats" } ] }
436
- } }
436
+ } }
437
437
} } ]
438
438
439
439
Boolean Operations
@@ -451,7 +451,7 @@ using the methods described in this section.
451
451
452
452
* - `and() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlBoolean.html#and(com.mongodb.client.model.mql.MqlBoolean)>`__
453
453
- :manual:`$and </reference/operator/aggregation/and/>`
454
-
454
+
455
455
* - `not() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlBoolean.html#not()>`__
456
456
- :manual:`$not </reference/operator/aggregation/not/>`
457
457
@@ -657,7 +657,7 @@ into custom static methods.
657
657
- Aggregation Pipeline Operator
658
658
659
659
* - `passTo() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValue.html#passTo(java.util.function.Function)>`__
660
-
660
+
661
661
| **Typed Variants**:
662
662
| `passArrayTo() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlArray.html#passArrayTo(java.util.function.Function)>`__
663
663
| `passBooleanTo() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlBoolean.html#passBooleanTo(java.util.function.Function)>`__
@@ -719,7 +719,7 @@ The following code shows the pipeline for this aggregation:
719
719
720
720
.. code-block:: java
721
721
:copyable: true
722
-
722
+
723
723
var students = current().<MqlDocument>getArray("students");
724
724
725
725
asList(project(fields(
@@ -762,7 +762,7 @@ types using the methods described in this section.
762
762
763
763
* - `asDocument() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlMap.html#asDocument()>`__
764
764
- *No corresponding operator*
765
-
765
+
766
766
* - `asMap() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlDocument.html#asMap()>`__
767
767
- *No corresponding operator*
768
768
@@ -798,7 +798,7 @@ The following code shows the pipeline for this aggregation:
798
798
var graduationYear = current().getString("graduationYear");
799
799
800
800
asList(addFields(
801
- new Field("reunionYear",
801
+ new Field("reunionYear",
802
802
graduationYear
803
803
.parseInteger()
804
804
.add(5))
@@ -894,10 +894,10 @@ the Query API:
894
894
[ { $match: {
895
895
$expr: {
896
896
$eq: [ {
897
- $dayOfWeek: {
897
+ $dayOfWeek: {
898
898
date: { $dateFromString: { dateString: "$deliveryDate" } },
899
899
timezone: "America/New_York" }},
900
- 2
900
+ 2
901
901
] }
902
902
} } ]
903
903
@@ -934,8 +934,8 @@ using the methods described in this section.
934
934
* - `setField() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlDocument.html#setField(java.lang.String,com.mongodb.client.model.mql.MqlValue)>`__
935
935
- :manual:`$setField </reference/operator/aggregation/setField/>`
936
936
937
- * - `unsetField() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/>`__
938
- - :manual:`$unsetField </reference/operator/aggregation/unsetField/MqlDocument.html#unsetField(java.lang.String) >`
937
+ * - `unsetField() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlDocument.html#unsetField(java.lang.String) >`__
938
+ - :manual:`$unsetField </reference/operator/aggregation/unsetField/>`
939
939
940
940
Suppose you have a collection of legacy customer data which includes
941
941
addresses as child documents under the ``mailing.address`` field. You want
@@ -983,10 +983,10 @@ the Query API:
983
983
[
984
984
{ $match: {
985
985
$expr: {
986
- $eq: [{
986
+ $eq: [{
987
987
$getField: {
988
- input: { $getField: { input: "$$CURRENT", field: "mailing.address"}},
989
- field: "state" }},
988
+ input: { $getField: { input: "$$CURRENT", field: "mailing.address"}},
989
+ field: "state" }},
990
990
"WA" ]
991
991
}}}]
992
992
@@ -997,7 +997,7 @@ You can perform a map operation on a value of either type ``MqlMap`` or
997
997
``MqlEntry`` using the methods described in this section.
998
998
999
999
.. tip::
1000
-
1000
+
1001
1001
You should represent data as a map if the data maps
1002
1002
arbitrary keys such as dates or item IDs to values.
1003
1003
@@ -1146,7 +1146,7 @@ The following code shows the pipeline for this aggregation:
1146
1146
.append(employeeID)
1147
1147
.toLower())
1148
1148
)));
1149
-
1149
+
1150
1150
The following code provides an equivalent aggregation pipeline in
1151
1151
the Query API:
1152
1152
0 commit comments