[DOCS-11037] Describe $out stage process Created: 20/Nov/17  Updated: 30/Oct/23  Resolved: 29/Nov/17

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Improvement Priority: Minor - P4
Reporter: Brian Moss Assignee: Brian Moss
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Participants:
Days since reply: 6 years, 11 weeks, 1 day ago

 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.



 Comments   
Comment by Kay Kim (Inactive) [ 29/Nov/17 ]

Sure

Comment by Githook User [ 20/Nov/17 ]

Author:

{'name': 'Brian Moss', 'username': 'kallimachos', 'email': 'kallimachos@gmail.com'}

Message: DOCS-11037 Describe $out stage process
Branch: v3.4
https://github.com/mongodb/docs/commit/5e35b5af3f94a5d1f39a68b94195e64fa868d4bd

Comment by Githook User [ 20/Nov/17 ]

Author:

{'name': 'Brian Moss', 'username': 'kallimachos', 'email': 'kallimachos@gmail.com'}

Message: DOCS-11037 Describe $out stage process
Branch: v3.4
https://github.com/mongodb/docs/commit/9c6d3745673a7658643c16b277d4a4286bafdacc

Comment by Githook User [ 20/Nov/17 ]

Author:

{'name': 'Brian Moss', 'username': 'kallimachos', 'email': 'kallimachos@gmail.com'}

Message: DOCS-11037 Describe $out stage process
Branch: master
https://github.com/mongodb/docs/commit/8b3f7f1f07ad66b900442cd45808898b5ba0a517

Comment by Githook User [ 20/Nov/17 ]

Author:

{'name': 'Brian Moss', 'username': 'kallimachos', 'email': 'kallimachos@gmail.com'}

Message: DOCS-11037 Describe $out stage process
Branch: master
https://github.com/mongodb/docs/commit/d6545351060271e27d2121c665aaa5a6852ef381

Comment by Brian Moss [ 20/Nov/17 ]

PR: https://github.com/mongodb/docs/pull/3099

Generated at Thu Feb 08 08:01:54 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.