-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
When calling the save() method I expect the returned object to be the object that was persisted in the database. However, I am finding that the returned object isn't the object as it was persisted, it is a copy of the object I passed in to be saved with its ID filled in. Things could happen in the database which mean this is not always the case (this is acknowledged by the documentation, which both specifies that the return value will be the object as persisted, and that this return value should be used for further processing as things may have changed in the database).
I ran into this issue because of the limited precision of Mongo's ISODateTime, although there are probably many other cases where this can happen.
Reproducer with failing test:
mongoentityissue.zip