Skip to content

Commit 8487b29

Browse files
RedBeard0531Sam Kleinman
authored andcommitted
Extend 2.6 release notes for $out
Filling in details on when the collection appears and what we do when the output collection already exists. Signed-off-by: Sam Kleinman <[email protected]>
1 parent 14db2f2 commit 8487b29

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

source/release-notes/2.6.txt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,20 @@ Aggregation Pipeline Changes
8888
:pipeline:`$out`.
8989

9090
:pipeline:`$out` will create a new collection if one does not
91-
already exist in the current database.
92-
91+
already exist in the current database. This collection will not be
92+
visible at that name until the aggregation completes. If the aggregation
93+
fails part-way through, no collection will be created.
94+
95+
If the output collection already exists, the behavior is the same
96+
as MapReduce's replace mode. To be specific if the aggregation completes
97+
successfully, the output collection will be atomically replaced by a newer
98+
version. Any indexes that existed at the start of the aggregation on the
99+
original output collection will also exist on the new collection.
100+
Importantly, this means that the pipeline will error out if the output
101+
documents would violate any unique indexes (including _id) that existed
102+
on the original output collection.
103+
104+
93105
You may *only* specify :pipeline:`$out` at the end of a pipeline.
94106

95107
.. example::

0 commit comments

Comments
 (0)