【发布时间】:2018-06-07 17:50:39
【问题描述】:
usermodel:
{
"_id" : ObjectId("5a2622b0004be35f4baf70e3"),
"username": "testuser",
"bankdetails" : [
{
"_id" : ObjectId("5a294146015da72db1560326"),
"bankname" : "bankofamerica"
}
]
}
samplemodel:
{
"_id" : ObjectId("5a41f785416d0d3d93794ca9"),
"bankid" : ObjectId("5a294146015da72db1560326"),
}
samplemodel.find().populate('bankid').exec(function(err,resData){
res.json(resData);
});
我已经使用了上面的代码,但没有使用这个代码......请给出一些解决方案来解决这个问题......
【问题讨论】:
-
你能解释一下你在这里想要达到的目标吗?
标签: arrays mongodb mongoose objectid