Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-11037

Describe $out stage process

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor - P4 Minor - P4
    • Server_Docs_20231030
    • None
    • manual
    • 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.

      Attachments

        Activity

          People

            brian.moss@mongodb.com Brian Moss
            brian.moss@mongodb.com Brian Moss
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              6 years, 11 weeks, 1 day ago