0
我是非關係數據庫的新手,因此我想知道如何建模我的數據。我的項目是一個簡單的待辦事項應用程序,具有項目和任務。請參閱下面我現在是怎麼做的,讓我知道,如果它是正確的還是什麼我可以做的更好:如何在MongoDB中建模數據?
projects: [{
_id: 23423423423,
name: projectName1,
tasks: [{
_id: 3423423423423324,
title: "do something",
isCompleted: "false"
},
{
_id: 23223423423324,
title: "do something else now",
isCompleted: "false"
},
{
_id: 232234233423423,
title: "i have completed this",
isCompleted: "true"
}]
},
{
_id: 2342123123,
name: projectName2,
tasks: [{
_id: 3423423423422314,
title: "build this",
isCompleted: "false"
},
{
_id: 2322342342234234,
title: "build something else now",
isCompleted: "false"
},
{
_id: 2322342323423423,
title: "i have completed building this",
isCompleted: "true"
}]
}
爲了補充說明,可能需要閱讀http://docs.mongodb.org/manual/core/data-modeling/,其中討論了MongoDB數據建模並在最後提供了示例模型的鏈接。 – 2013-04-11 14:47:23
謝謝你們兩位的回答。 @James Wahlin,那個鏈接非常有用! – 2013-04-11 23:02:42