Nodatime 'Instant' sorting issue #17339
-
From what I'm seeing, there seems to be something wrong, please take a look at the image: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
Hi Can you share the docs, query that reproduce the wrong results? |
Beta Was this translation helpful? Give feedback.
-
Hey, thanks for test. As @ayende said before, RavenDB is not aware about NodaTime format, thus your date is changed into standard string/term, rest of them are ISO compliant so will be changed into Ticks by indexing engine and your query (since order by has implicit type; no You can solve it by:
|
Beta Was this translation helpful? Give feedback.
Hey, thanks for test.
I'm not very familiar with NodaTime API but your problematic date (
2024-10-10T10:10:11.554013Z
) is not ISO 8601 format. https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings#RoundtripAs @ayende said before, RavenDB is not aware about NodaTime format, thus your date is changed into standard string/term, rest of them are ISO compliant so will be changed into Ticks by indexing engine and your query (since order by has implicit type; no
as string
/as long
etc) and that means it will use Ticks since your field has them.You can solve it by:
Transform your data from
Instant
intoDateTime
(or other) in index viaAdditionalSo…