spring-guides / gs-accessing-data-mongodb

Accessing Data with MongoDB :: Learn how to persist data in MongoDB.
http://spring.io/guides/gs/accessing-data-mongodb/
Apache License 2.0
139 stars 161 forks source link

LocalDate handling is not working well #23

Closed puskai closed 1 year ago

puskai commented 5 years ago

I have added two fields to the complete version:

public LocalDate birthdate;
public TreeMap<LocalDate, Double> dateValues;

The customer gets saved like this:

{ "_id" : ObjectId("5c0918435deea55a9522cecd"), "firstName" : "Oliver August", "lastName" : "Matthews", "birthdate" : ISODate("2018-12-05T23:00:00.000Z"), "dateValues" : { "2018-12-05" : 43.0, "2018-12-06" : 42.0 }, "_class" : "hello.Customer" }

After that reading is not working any more: No converter found capable of converting from type [java.lang.String] to type [java.time.LocalDate]

You can see it here: https://github.com/puskai/gs-accessing-data-mongodb

Buzzardo commented 1 year ago

I suggest asking that question on Stack Overflow.