title: data is not insert in mongodb
body: <p>I am beginner of nodejs and mongodb. I am inserting data to collection using mongoose ORM and model but not insert. Validation is working correct but data is not insert after filling complete data. I have not create collection in database manually. should I create collection manually in mongodb or create automatically when inserting document.</p>
  
  <p>productsController</p>
  
  <pre><code>var mongoose = require('mongoose');
  var db = require('../config/db_config');
  var Product = require('../models/product');
  //var Product = mongoose.model('Products');
  var productController = {};
  
  productController.add = function(req, res) {
      var params = req.body;
  
      if(!params) {
          res.status(400).send({message: "Data can not be empty"});
      }
  
      var productData = new Product({
          product_name : params.product_name,
          price : params.price,
          category : params.category
      });
  
      console.log(productData);
  
      productData.save(function(err, product) {
          if (err){
            res.status(400).send({message:'Unable to save data! ' + err});
          }else{
              res.status(200).send({message:'Data has been saved! ' + product });
          }
      });
  };
  
  module.exports = productController;
  </code></pre>
  
  <p>Models code is here</p>
  
  <pre><code>var mongoose = require('mongoose');
  var db = require('../config/db_config');
  var Schema = mongoose.Schema;
  
  var productSchema = new Schema({
  
    product_name: { type: String, required:  'Product name cannot be left blank.' },
  
    price:    { type: String,     required:  'Product price cannot be left blank.'},
  
    category: { type: String ,    required:  'Product category cannot be left blank'},
  
    updated_at : {type: Date, default: Date.now}
  
  });
  
  module.exports = mongoose.model('Products', productSchema);
  </code></pre>
  
  <p>routes file code is here:</p>
  
  <pre><code>var express = require('express');
  var router = express.Router();
  var mongoose = require('mongoose');
  var Product = require('../models/product.js');
  var productsController = require('../controllers/productsController');
  
  router.post('/add',productsController.add);
  
  module.exports = router;
  </code></pre>
  
  <p>DB config file</p>
  
  <pre><code>var mongoose = require('mongoose');
  
  mongoose.Promise = global.Promise;
  
  var db = mongoose.createConnection('mongodb://localhost:27017/nodeweb', function(err,db){
      if(err){
          throw err;
          console.log(err);
      } else {
          console.log('Successfully connected to database!');
      }
  });
  module.exports = db;
  </code></pre>
  
  <p>I have insert controller, model and routes file code. </p>