【发布时间】:2018-07-24 12:12:35
【问题描述】:
我有一个网站,我想做这样的事情:
myModel.create({myObject}); //I want to access the automatically created objectId of this new document
refModel.create({refId:somehowAccessId});
//Or, without Mongoose
db.myCollection.insert({myObject});
db.refCollection.insert({refId:somehowAccessId})
这是如何完成的(最好不使用find 查询和回调)。
【问题讨论】:
标签: node.js database mongodb mongoose ref