我在MongoDB中有两个集合(我也使用节点js)
First:
{ _id: "France", color: "red", Refid: { "1": "FRA1", "2": "FRA2"}}
Second:
{ _id: "FRA1", color: "blue", info : "Country"}
{ _id: "FRA2", color: "white", info : "Country"}
如何在例如console.log中显示数据以向我显示beetwen集合的引用? 我想以这种方式显示数据(当我输入db.first.find()。pretty())时:
{ _id: "France", color: "red", Refid:
{ "1": "FRA1", color: "blue", info : "Country",
"2": "FRA2", color: "white", info : "Country"}
}
}