mongo db docs가이 질문에 대답하지만 답변이 잘못되었습니다.mongodb에서 _id를 사용하여 컬렉션간에 일대 다 관계를 모델링하는 방법은 무엇입니까?
{
_id: "oreilly",
name: "O'Reilly Media",
founded: 1980,
location: "CA"
}
{
_id: 123456789,
title: "MongoDB: The Definitive Guide",
author: [ "Kristina Chodorow", "Mike Dirolf" ],
published_date: ISODate("2010-09-24"),
pages: 216,
language: "English",
publisher_id: "oreilly"
}
{
_id: 234567890,
title: "50 Tips and Tricks for MongoDB Developer",
author: "Kristina Chodorow",
published_date: ISODate("2011-05-06"),
pages: 68,
language: "English",
publisher_id: "oreilly"
}
이 문서 오류가 : Model Referenced One-to-Many Relationships Between Documents에 MongoDB를 문서에서, 그들은 다음과 같은 대답을? 예제의 _id 사용은 문서화 된 설명 Mongodb's ObjectId과 충돌하는 것 같습니다.
publisher_id에 12 바이트 BSON 개체 ID를 사용하는 것이 올바른 해결책입니까?