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

Do not rely on query result order in bucket_unpacking_with_limit.js

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Execution
    • Fully Compatible
    • ALL
    • Storage Execution 2025-03-31
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The aggregate command with pipeline

      pipeline: [
          {
              $match: {
                  $nor: [
                      {"temp": {$in: []}},
                  ]
              }
          },
          {$limit: 5},
          {$sort: {"m.sensorId": 1}},
          {$skip: 2},
          {$limit: 2}
      ]

      performs limit before sort. It cannot assume which documents will be returned eventually then.

            Assignee:
            yuhong.zhang@mongodb.com Yuhong Zhang
            Reporter:
            yuhong.zhang@mongodb.com Yuhong Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              None
              None
              None
              None