Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-60762

$setWindowFields partitionBy an array should consistently error

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.2.0, 5.1.0-rc3, 5.0.5
    • Affects Version/s: None
    • Component/s: None
    • None
    • Minor Change
    • ALL
    • v5.1, v5.0
    • QO 2021-11-01
    • 175

      $setWindowFields raises an error if the partitionBy expression ever evaluates to an array. (We added this restriction to allow $sort to handle most of the partitioning.)

      But during parsing, if the partitionBy expression optimizes to a constant, we remove it. (Partitioning by a constant is equivalent to not doing any partitioning.) We do this even if it's a constant array, which hides the error. This is misleading: we say partitionBy can't be an array, but then examples like 'partitionBy: [1, 2, 3]' don't raise an error.

            Assignee:
            david.percy@mongodb.com David Percy
            Reporter:
            david.percy@mongodb.com David Percy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: