Mongo can't bring records which are in far far future like 2394-10-20T16:10:23
now: 2025-11-17
Description:
I have a timeseries collection in mongo and here is the command to created it:
db.createCollection( "tick", { timeseries: { timeField: "created_at", metaField: "id", granularity: "seconds", } } ) I figured out that there is some data which is for future (a tiny mistake) like: 2394-10-23T16:10:23.721Z in created_at field, and when I want to run below query:
db.tick.aggregate([ { $sort: {created_at: 1} }, ]) I'll get this error:
Command failed with error 6369910 (Location6369910): 'PlanExecutor error during aggregation :: caused by :: BoundedSorter input is too out-of-order: with bound 2394-11- 13T09:16:00.000+00:00, did not expect input 2025-09-29T15:17:27.815+00:00' on server ip:port. The full response is {"ok": 0.0, "errmsg": "PlanExecutor error during aggregation :: caused by :: BoundedSorter input is too out-of-order: with bound 2394-11-13T09:16:00.000+00:00, did not expect input 2025-09-29T15:17:27.815+00:00", "code": 6369910, "codeName": "Location6369910"} I also tried descending order for created_at
But it couln't show me the future records.
So how did I find them?
I run my query with natural order (not specifying sort) in my JetBrains IDE.