title: Number type in mongoose schema always get saved as string
body: <p>I have this simple schema, with contact as Number data type. Strangely, the input data(contact) always gets saved as string in mongodb. I have no idea, as to what is happening in the background, or am I missing something.</p>
  
  <pre><code>var mongoose = require('mongoose');
  var memberSchema = new mongoose.Schema({
  .
  . Other fields are not shown/ necessary 
  .
  contact: {
     type: Number,
     required: true,
     }
  });
  
  module.exports = mongoose.model('Member',memberSchema);
  </code></pre>
  
  <p>In my routes file, I send user data for adding into DB like this</p>
  
  <pre><code>exports.post = function(req,res,next){
      if(!req.body.name || !req.body.email || !req.body.contact)
          return res.render('index', {error: 'Fill Name, Email and Contact'});
      //req.body.contact = parseInt(req.body.contact);
      var member = {
          name: req.body.name,
          email: req.body.email,
          contact: req.body.contact
  }
  </code></pre>
  
  <p>As you can see req.body.contact is whatever user has entered in a form and I pass it that way.</p>
  
  <p>The problem is, either I am not understanding the actual concept or there must me something more to it.
  Note: I am not using any express or mongoose validator middlewares.</p>
  
  <p>Any help would be highly appreciated. </p>