Hi I am newbie to mongodb.I am using java.
I have 2 tables system, system_properties in my relational table.
Something like this.
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
I am trying to create a schema for this. eg: for inserting one doc
System
{
"_id" : 100
"System_Info" : "cisc"
System_Properties :
{ "system_id":100
[{prop_Key : "good", Description: "success"},
{prop_Key : "better", Description: "progress"}] }
}
Is this the best schema for this design?
To avoid joins only we are embedding documents.
I have a doubt whether system_id : 100 (Foreign key in relational tables) is necessary since "_id" = 100 (primarykey in Relational table)is also refers the same.