Default conversion for $date type should be Instant #4864
Labels
status: feedback-reminder
We've sent a reminder that we need additional information before we can continue
status: waiting-for-feedback
We need additional information before we can continue
When deserialising to a Map or similar flexible type $date fields get deserialised as java.util.date
e.g: something like
mongoTemplate.find(query, Map.class, "myCollection")
will convert:
returning a Date for the "time" field.
java.util.Date is an antiquated, broken and difficult to use class. Since timezone ('z') information is specified in the value the natural default conversion would be java.time.Instant. (or possibly a ZonedDateTime but this is possibly less convenient in the majority of cases)
In general all uses of java.util.Date and java.util.Calendar should be removed.
The text was updated successfully, but these errors were encountered: