Closed scj7t4 closed 1 year ago
thanks for pointing that out - good catch.
We've been revisiting this issue and decided to not change the current behaviour as we do consider Document
a store native type, that if provided by the user, should in this case only contain values understandable by the driver. Having each and every Document
type do another round of potential mapping would also negatively impact runtime behaviour.
I've noticed an inconsistency with how JSR-310
LocalDate
is converted to mongo dates when it is put intoorg.bson.Document
.Reproduction:
Using 'org.springframework.boot:spring-boot-starter-data-mongodb:2.5.6'
(Full project repro here: https://github.com/scj7t4/mongodb-localdate-bug)
When I run this test, I expect the values of
fieldA
andinner.fieldB
to be the same. However, they are not equal,fieldA
is2001-01-01T00:00:00 MST
as expected, butinner.fieldB
is2000-12-31T17:00:00 MST
(7 hours earlier) in my timezone.I would expect that both values would be the same.
Thanks for all the work you do developing Spring Mongo :)