title: Mongoose : Inserting JS object directly into db
body: <p>Ok so I have a JS object that is being POSTed via AJAX to the nodejs backend. I want to insert this js object directly into my mongoose db as the object keys already match up perfectly with the db schema. </p>
  
  <p><strong>I currently have this (not dynamic and overly complex):</strong></p>
  
  <pre><code>app.post('/items/submit/new-item', function(req, res){
      var formContents = req.body.formContents,
          itemModel = db.model('item'),
          newitem = new itemModel();
  
      newitem.item_ID         = "";
      newitem.item_title      = formContents.item_title;
      newitem.item_abv        = formContents.item_abv;
      newitem.item_desc       = formContents.item_desc;
      newitem.item_est        = formContents.item_est;
      newitem.item_origin     = formContents.item_origin;
      newitem.item_rating     = formContents.item_rating;
      newitem.item_dateAdded  = Date.now();
  
      newitem.save(function(err){
          if(err){ throw err; }
          console.log('saved');
      })
  
      res.send('item saved');
  });
  </code></pre>
  
  <p><strong>But want to trim it down to something like this (sexy and dynamic):</strong></p>
  
  <pre><code>app.post('/items/submit/new-item', function(req, res){
      var formContents = req.body.formContents,
  
      formContents.save(function(err){
          if(err){ throw err; }
          console.log('saved');
      })
  
      res.send('item saved');
  });
  </code></pre>