@@ -90,13 +90,13 @@ SQL statement:
90
90
Considerations
91
91
--------------
92
92
93
- Duplicates Results
93
+ Duplicate Results
94
94
~~~~~~~~~~~~~~~~~~
95
95
96
96
The combined results from the previous stage and the
97
97
:pipeline:`$unionWith` stage can include duplicates.
98
98
99
- For example, create a suppliers collection:
99
+ For example, create a `` suppliers`` collection and a ``warehouses`` collection:
100
100
101
101
.. code-block:: javascript
102
102
@@ -114,9 +114,8 @@ For example, create a suppliers collection:
114
114
{ _id: 3, warehouse: "C", region: "East", state: "Florida" },
115
115
])
116
116
117
- The following aggregation which combines the results from the ``state``
118
- field projection from the ``suppliers`` collection with the results
119
- from the ``state`` field projection from the ``warehouse`` collection:
117
+ The following aggregation combines the ``state`` field projection results from
118
+ the ``suppliers`` and ``warehouse`` collections.
120
119
121
120
.. code-block:: javascript
122
121
@@ -125,11 +124,11 @@ from the ``state`` field projection from the ``warehouse`` collection:
125
124
{ $unionWith: { coll: "warehouses", pipeline: [ { $project: { state: 1, _id: 0 } } ]} }
126
125
])
127
126
128
- As can be seen from the returned documents, the result set contains
129
- duplicates:
127
+ The result set contains duplicates:
130
128
131
129
.. code-block:: javascript
132
130
:emphasize-lines: 2,5
131
+ :copyable: false
133
132
134
133
{ "state" : "Texas" }
135
134
{ "state" : "Colorado" }
@@ -152,6 +151,7 @@ group by the ``state`` field:
152
151
The result set no longer contains duplicates:
153
152
154
153
.. code-block:: javascript
154
+ :copyable: false
155
155
156
156
{ "_id" : "California" }
157
157
{ "_id" : "Texas" }
0 commit comments