0
symfony2와 Doctrine ODM을 사용합니다.Doctrine odm reference 많은 replicate 참조
나는 출판물이있다.
...\Publication:
fields:
id:
id: true
strategy: INCREMENT
dateDebut:
type: date
dateFin:
type: date
나는 문서 podcast를 referenceMany로 가지고 있습니다.
db.Podcast.find({'_id':2})
이 결과 :이 요청을 소성
...\Podcast:
fields:
id:
id: true
strategy: INCREMENT
referenceMany:
publications:
targetDocument: ...\Publication
cascade: all
.
db.Podcast.find({'_id':2})
이 결과 : 나 persit 및 팟 캐스트를 씻고 난 요청 소성
{ "_id" : 2,
...
"publications" : [{"$ref" : "Publication","$id" : 3}]
...
}
.
{ "_id" : 2,
...
"publications" : [
{"$ref" : "Publication","$id" : 3},
{"$ref" : "Publication","$id" : 3}
]
...
}
왜 참조가 중복되는가?