_ = require("underscore")
var model = new Example(_.extend({ userId: req.user._id }, req.body))
oder wenn Sie userId in req.body kopieren möchten:
var model = new Example(_.extend(req.body, { userId: req.user._id }))
_ = require("underscore")
var model = new Example(_.extend({ userId: req.user._id }, req.body))
oder wenn Sie userId in req.body kopieren möchten:
var model = new Example(_.extend(req.body, { userId: req.user._id }))