File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
source/reference/operator/aggregation Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -67,15 +67,14 @@ Replace Existing Collection
6767
6868If the collection specified by the :pipeline:`$out` operation already
6969exists, then upon completion of the aggregation, the :pipeline:`$out`
70- stage atomically replaces the existing collection with the new
71- results collection using the following process:
72-
73- #. A temp collection is created.
74- #. Indexes are copied from the destination collection to the temp collection.
75- #. Documents are inserted into the temp collection.
76- #. The temp collection calls `renameCollection
77- <https://docs.mongodb.com/manual/reference/method/db.collection.renameCollection/>`__,
78- providing the name of the destination collection and ``dropTarget: true``.
70+ stage atomically replaces the existing collection with the new results
71+ collection. Specifically, the :pipeline:`$out` operation:
72+
73+ #. Creates a temp collection.
74+ #. Copies the indexes from the existing collection to the temp collection.
75+ #. Inserts the documents into the temp collection.
76+ #. Calls :method:`db.collection.renameCollection` with ``dropTarget: true``
77+ to rename the temp collection to the destination collection.
7978
8079The :pipeline:`$out` operation does not change any indexes that existed on the
8180previous collection. If the aggregation fails, the :pipeline:`$out` operation
You can’t perform that action at this time.
0 commit comments