-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
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.
- related to
-
SERVER-79773 Complete TODO listed in SERVER-79621
- Closed