title: Mongoose save all parameters from request body
body: <p>I'm setting up a little API, I do some data validation on the client side of my application and whilst I do that I'm structuring my data to match my mongoose schema.</p>
  
  <p>I'm attempting to do this...</p>
  
  <pre><code>router.route('/car')
  .post(function(req, res) {
      var car = new Car();
  
      car = req.body; // line under scrutiny
  
      car.save(function(err) {
          if(err) {
              console.log(err);
              res.status(400);
              res.send(err);
          }
          else {
              res.status(200);
              res.json({
                  message: req.body.name + ' successfully registered!'
              });
          }
      });
  });
  </code></pre>
  
  <p>but of course, this is currently removing all the model parameters of <code>car</code> provided by mongoose, so the save method e.t.c are no longer functional.</p>
  
  <p>I have attempted <code>car.data = req.body</code> but this requires all of my mongoose schemas to be wrapped into a <code>data</code> object which isn't so elegant.</p>
  
  <p>I was wondering if there was any way to avoid preparing the <code>car</code> object to be saved without the long-hand of;</p>
  
  <pre><code>car.name = req.body.name;
  car.seats = req.body.seats;
  car.engine_size = req.body.engine_size; 
  </code></pre>
  
  <p>e.t.c.</p>
  
  <p>I'm essentially wanting to do the equivalent of <code>car.push(req.body);</code> but again, the <code>.push()</code> method is not available to mongoose models.</p>