You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.
In reporting, it is not possible to order by date (timestamp) in an acending order. Only decending. Below is an example of reports ordered by timestamp ascending:
The same problem occurs if we run queries directly against Mongo in Studio 3T:
I got the timestamp from the top 5 documents and they have the same problem as in the frontend. Descending works but ascending is apparently random:
The timestamp is stored as an array and that might be causing problems for the sorting, but I do not know why descending is working
Timestamp" : [
637013082263970000,
0
]
Sorting should work on timestamp for both descending and ascending order
The text was updated successfully, but these errors were encountered:
Velcrow81
changed the title
Sorting/Ordering by timestamp in Mongo is not working
Sorting/Ordering reports by timestamp in Mongo is not working
Sep 4, 2019
With arrays, a less-than comparison or an ascending sort compares the smallest element of arrays, and a greater-than comparison or a descending sort compares the largest element of the arrays.
So the ascending sort doesn't work because the smallest element of the array is always 0 in this case.
MongoDB has it's own Timestamp type, but our timestamp is stored as an array of NumberLong.
My guess is this needs a fix from the dolittle framework @woksin@jakhog ? Or can we specify mongo types ourselves?
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
In reporting, it is not possible to order by date (timestamp) in an acending order. Only decending. Below is an example of reports ordered by timestamp ascending:
The same problem occurs if we run queries directly against Mongo in Studio 3T:
I got the timestamp from the top 5 documents and they have the same problem as in the frontend. Descending works but ascending is apparently random:
Ascending
637013082263970000
637012111923990000
637012506804020000
637019928394040000
637020792304050000
Descending
637041960614550000
637039299834670000
637035012714420000
637034735494500000
637033988174520000
The timestamp is stored as an array and that might be causing problems for the sorting, but I do not know why descending is working
Sorting should work on timestamp for both descending and ascending order
The text was updated successfully, but these errors were encountered: