spring-data-mongodb icon indicating copy to clipboard operation
spring-data-mongodb copied to clipboard

Save Map with list of objects in value as DBRef [DATAMONGO-2132]

Open spring-projects-issues opened this issue 7 years ago • 2 comments

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

spring-projects-issues avatar Nov 14 '18 15:11 spring-projects-issues

Filia commented

I have the same problem :(

spring-projects-issues avatar Nov 14 '18 15:11 spring-projects-issues

I have same problem.

Sukesh190 avatar Sep 24 '22 07:09 Sukesh190

This is something we do not plan to support.

christophstrobl avatar Mar 01 '23 13:03 christophstrobl