0
加入對MongoDB的操作我有兩個表如何執行使用Java
1. Department collection 2. Employee collection
Both the table have unique _id. I have stored multiple employee ids on Department collection.
Employee Collection:
{
_id:"EMP1",
name:"Arjun Singh",
designation:"developer"
},
{
_id:"EMP2",
name:"Hitesh",
designation:"VTS support"
}
Department Collection:
{
_id:"3",
name:"XYZ Department",
employeeList:["EMP1","EMP2"]
}
後執行蒙戈DB連接我需要在以下格式的數據
{
_id:"3",
name: "XYZ Department",
employeeList:[
{
_id:"EMP1",
name:"Arjun Singh",
designation:"developer"
},
{
_id:"EMP2",
name:"Hitesh",
designation:"VTS support"
}
]
}
請幫助我如何在mongoDb中執行連接
你得提供你的企圖,並指導我們具體的問題。 – notyou