-
Type: Bug
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: 3.6.1, 3.7.9
-
Component/s: Aggregation Framework, Querying
-
Query Optimization
-
ALL
-
v4.0
-
-
Query 2018-06-04, Query 2018-07-02
The ObjectId type in the server treats the timestamp portion as a 32-bit signed integer. This should be treated as an unsigned integer instead, increasing the range of dates into the future, and bringing the server more in line with the drivers.
As one example of what can go wrong, see below.
When the $dateToString function is applied to an ObjectID's timestamp portion, the timestamp portion is interpreted as a 32-bit signed integer. This is inconsistent with the shell's ObjectId.getTimestamp() method, and the definition of the first 4 bytes of the https://docs.mongodb.com/manual/reference/method/ObjectId/: "a 4-byte value representing the seconds since the Unix epoch"
- links to