[英]How do I pass an object element in express using Mongo?
I want to pass a whole object from an ejs template 我想从ejs模板传递整个对象
For example: 例如:
var schema = ... { Name: [{ var schema = ... {名称:[{
}] } }]}
With this you can achieve it, hope that's what you ask... 有了这个,您就可以实现,希望这就是您要的...
notifications: {
notifiId: {type: Schema.Types.ObjectId, ref: 'Notifications' },
viewed: { type: Number, default: 0 }
},
and to find it: 并找到它:
model_Variable.findById(req.params.id).populate("notifiId").exec(function (err,
callBack) {});
Source: How to populate in this case Mongoose 资料来源: 如何在这种情况下填充猫鼬
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.