title: saving unstructured data in mongoose
body: <p>I am able to save request the data if I explicitly define in my express model the structure, but I am not able to save record if I do not explicitly define the data structure.</p>
  
  <p>For example I am able to save if I have this in my model</p>
  
  <pre><code>....
  module.exports = mongoose.model('Form', new Schema({
      name: String,
      password: String,
      admin: Boolean
  }));
  ...
  ...
  </code></pre>
  
  <p>but I am not able to save it if I have it like this</p>
  
  <pre><code>module.exports = mongoose.model('Form', new Schema());
  </code></pre>
  
  <p>Here is my model</p>
  
  <pre><code>// get an instance of mongoose and mongoose.Schema
  var mongoose = require('mongoose');
  var Schema = mongoose.Schema;
  
  // set up a mongoose model and pass it using module.exports
  module.exports = mongoose.model('Form', new Schema());
  </code></pre>
  
  <p>And here is my Router</p>
  
  <pre><code>apiRouter.post('/forms/createForm', function(req, res) {
  
      var form = new Form(req.body);
  
      form.save(function(err) {
          if (err) throw err;
  
          console.log('Form saved successfully');
          res.json({ success: true });
      });
  
  });
  </code></pre>
  
  <p>Thanks</p>