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

Consider adding a way to figure out the number of measurements in a bucket

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Integration
    • Fully Compatible
    • QI 2023-08-21

      Quoting Irina's comment here:
      I believe that we will have to always include _id field even if it isn't explicitly used in a query because otherwise we won't be able to identify the gaps at the tail of a column (for queries like [{$match: {foo: {$ne: 42}}, {$count: "n"]), that is we need a guaranteed "dense" field among the paths the stage is deblocking from. I mean, the code here isn't wrong but we should probably document in the stage's header that it requires a dense path for correctness (I've also added a similar comment to the design doc).

      Yoonsoo's reply:
      Thanks for pointing this out! This is definitely concerning. Even _id field can be missing like after db.ts.updateMany({}, {$unset: {_id: ""}}). But the time field must always exist. Probably we can always include the time field instead. I think it would be a better option to add a VM builtin function which returns the number of rows in a bucket.

            Assignee:
            yoonsoo.kim@mongodb.com Yoon Soo Kim
            Reporter:
            yoonsoo.kim@mongodb.com Yoon Soo Kim
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: