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

[SERVER] Add dryRun option to the collMod command

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • 5.2.0
    • 5.3.0, 6.0.0
    • manual, Server

    Description

      Original Downstream Change Summary

      Add a new option, "dryRun", to the collMod command that is not a part of the stable API.

      When running collMod with unique: true and dryRun: true on an existing non-unique index, the server will scan every key and check for duplicates. If duplicates are detected, it will return a CannotConvertIndexToUnique error with a list of violations. The user is expected to fix these conflicting documents before expecting a successful conversion.

      This flag is only meant to be used alongside "unique: true". Other combinations are disallowed.

      Description of Linked Ticket

      Running this option with the collMod command indicates that we will not attempt to convert the index.

      Attachments

        Activity

          People

            ashley.brown@mongodb.com Ashley Brown
            backlog-server-pm Backlog - Core Eng Program Management Team
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              1 year, 48 weeks, 2 days ago