title: How can I use two different req items to create a new document in MongoDB?
body: <p>In my application, I have <code>req.body</code> and <code>req.user</code>. I want to use both of these to create a new document. This is as far as I was able to get with my code. It seems like Model.create only takes one of these inputs, though. What's the best way to get both <code>createdBy</code> and the data contained within <code>req.body</code> to create the new document?</p>
  <pre><code>exports.createOne = Model =&gt;
    catchAsync(async (req, res, next) =&gt; {
      const createdBy = req.user.id;
      const doc = await Model.create(req.body, createdBy);
      res.status(201).json({
        status: 'success',
        data: {
          data: doc
        }
      });
    });
  </code></pre>