Spring-Data-MongoDB: Failed to convert from type after upgrade to 2.0.7 with custom converter
Spring Data MongoDB 2.0.7 considers ZonedDateType
as simple type. You need to disambiguate converters into reading and writing converters by adding @ReadingConverter
/@WritingConverter
.
In your arrangement above, the framework attempts to convert all String
values into ZonedDateTime
. Instead, you want to represent rather ZonedDateTime
objects as String
in your MongoDB. So adding @WritingConverter
to ZonedDateTimeToStringConverter
and @ReadingConverter
to the other one fixes your issue.