嗨,我是新手來mongodb.I使用java。Mongodb Schema設計合適的一個建議
我在我的關係表中有2個表系統,system_properties。
就是這樣。
Table Fields values
System System_ID(PK), System_Info 100, cisc
200, Gets
System_prop System_ID(FK), Prop_key, Description 100, good, success
100, better,progress
200, worse,failed
我正在嘗試爲此創建一個模式。例如:用於插入一個文檔
System
{
"_id" : 100
"System_Info" : "cisc"
System_Properties :
{ "system_id":100
[{prop_Key : "good", Description: "success"},
{prop_Key : "better", Description: "progress"}] }
}
這是這個設計的最佳模式嗎?
爲了避免只加入我們嵌入的文件。
由於「_id」= 100(關係表中的主鍵)也是相同的,所以我懷疑system_id:100(關係表中的外鍵)是否必要。
http://www.manning.com/banker/(MongoDB的行動) HTTP:/ /www.10gen.com/presentations/mongosf2011/schemabasics http://www.10gen.com/presentations/mongosv-2011/schema-design-by-example http://www.10gen.com/presentations/mongosf2011/schemascale 以下是一些示例模式設計: http://docs.mongodb.org/manual/use-cases/ – Louisa