Details
-
Improvement
-
Resolution: Fixed
-
Minor - P4
-
None
-
None
Description
We mention in the $out documentation that if you specify an existing collection then that collection is atomically replaced by the $out stage. However, we do not specify the actual process for how this is done and you have to read the codebase.
1. A temp collection is created.
2. Indexes are copied from the destination collection to the temp collection.
3. Documents are inserted into the temp collection.
4. The temp collection calls renameCollection providing the name of the destination collection and dropTarget: true.