0

By default it looks like mongojack stores DateTime as a long in Mongo. Is there a simple way to have it store the dates as BSON Date instead?

For example the following ends up as a long in Mongo and I'd want to have a BSON Date

@JsonProperty("date") date: DateTime
Neil Lunn
  • 148,042
  • 36
  • 346
  • 317
Kohl
  • 11
  • 1
  • 2
  • Can you show me an example ? Is `DateTime` from joda lib ? Have you tried using `java.util.Date` ? – s7vr Jun 08 '17 at 01:05
  • Note that the [answer from the orignal poster of the duplicate](https://stackoverflow.com/a/29403386/2313887) question is actual answer. For some reason the answer that incorrectly tries to render a string "ISODate" was accepted. That is incorrect since it would just be stored as a "string" and not a BSON date. – Neil Lunn Jun 08 '17 at 03:11

0 Answers0