Skip to content

DuplicateKeyException on save lazy loaded references #5031

@MuravlevAS

Description

@MuravlevAS

Mongo repository throws DuplicateKeyException when I use save() method with object that was lazily loaded
from @DocumentReference

spring-data-mongodb version: 4.5.1

Failing test in demo project that shows the bug:
https://github.com/MuravlevAS/spring-mongodb-reference-demo/blob/master/src/test/java/com/example/demo/Demo1ApplicationTests.java#L25-L45

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions