Simplify $out stage by removing unnecessary stripping of clusteredIndex/validator fields

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Catalog and Routing
    • 1
    • 🟦 Shard Catalog
    • None
    • None
    • None
    • None
    • None
    • None

      In OutStage::createTemporaryCollection(), when creating the temporary collection for $out to a timeseries target, the code strips the "clusteredIndex" and "validator" fields from the original collection options obtained via listCollections. This was needed because passing those fields alongside the "timeseries" field to the create command was invalid.

      However, SERVER-105339 already fixed listCollections to not return "clusteredIndex" and "validator" for viewless timeseries collections, and SERVER-56933 established the principle that listCollections output should be directly usable to recreate collections. Therefore the removeFields workaround should no longer be necessary and the code can be simplified.

      The fix should:

      1. Remove the {{removeFields( {"clusteredIndex", "validator"}

        )}} call

      2. Verify that listCollections already excludes these fields for all timeseries collection types
      3. Add test coverage to ensure $out to timeseries works without the stripping logic

            Assignee:
            Unassigned
            Reporter:
            Tommaso Tocci
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: