MongoDB를 둘러보고 나는 최선의 해결책이 무엇인지 궁금합니다. 컬렉션 동물과 각 동물의 이름과 유형이 있습니다.NoSQL 중복 데이터 또는 새 문서
프런트 엔드 필요에 따라 각 유형마다 색상이 있습니다.
먼저 하나 :
Animal
.animal 1
name: Simba
race: lion
type:
name: felin
color: blue
.animal 2
name: Franck
race: turtle
type:
name: turtle
color: red
.animal 3
name: Francis
race: turtle
type:
name: turtle
color: red
둘째 :
Animal
.animal 1
name: Simba
race: lion
type: (id of type collection)
Type
.type 1
name: felin
color: blue
.type 2
name: turtle
color: red
그래서, 중복해야 데이터
그래서 두 가지 가능성이있다? 아니면 새로운 컬렉션을 만들어야합니까?
시간 내 주셔서 감사합니다.