spring-data-mongodb
spring-data-mongodb copied to clipboard
Save Map with list of objects in value as DBRef [DATAMONGO-2132]
yuremboo opened DATAMONGO-2132 and commented
Add possibility to save as DBRef Map with value which has list of entity objects. E.g.
@DBRef
private Map<String, List<Child>> children;
Expected behavior: In mongodb we'll get:
"children": {
"child1": [
{"$ref": "Child","$id": "5e6c1dec-4744-4eff-94c3-f66727d63156","$db": ""}, {"$ref": "Child","$id": "5e6c1dec-4744-4eff-94c3-f66727d85469","$db": ""}
], "child2": [ {"$ref": "Child","$id": "856c1dec-4744-4eff-94c3-f66727d63156","$db": ""}, {"$ref": "Child","$id": "886c1dec-4744-4eff-94c3-f66727d85469","$db": ""} ]
}
Actual behavior:
MappingException: No id property found on class class java.util.ArrayList
7 votes, 5 watchers
I have same problem.
This is something we do not plan to support.