_ = require("underscore")
var model = new Example(_.extend({ userId: req.user._id }, req.body))
ou si vous souhaitez copier userId dans req.body :
var model = new Example(_.extend(req.body, { userId: req.user._id }))
_ = require("underscore")
var model = new Example(_.extend({ userId: req.user._id }, req.body))
ou si vous souhaitez copier userId dans req.body :
var model = new Example(_.extend(req.body, { userId: req.user._id }))