_ = require("underscore")
var model = new Example(_.extend({ userId: req.user._id }, req.body))
или ако искате да копирате userId в 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))
или ако искате да копирате userId в req.body:
var model = new Example(_.extend(req.body, { userId: req.user._id }))