title: I am trying to save latitude and longitude to mongoose model but I am unable to store them
body: <p>Here is my mongoose model </p>
  
  <pre><code>var mongoose = require('mongoose'),
  Schema = mongoose.Schema
  
  var DriverSchema = new mongoose.Schema({
  
      carNumber : {type : String, required : true, unique : true},
  
      DriverName : {type : String, required : true},
  
      loc : {
          type: [Number],
          index:'2d'
      }
  
  });
  </code></pre>
  
  <p>I am trying to post the latitude and longitude from postman which is :</p>
  
  <pre><code>carNumber         KA51B7499
  DriverName        Sachin
  longitude         74.9999
  latitude          67.2563
  </code></pre>
  
  <p>I am saving this request in mongoose in the following code :</p>
  
  <pre><code>router.post('/',function(req,res){
  
      var Driver = new trackCab({
          carNumber: req.body.carNumber,
          DriverName: req.body.DriverName,
          loc: {
              type: [parseFloat(req.body.longitude),parseFloat(req.body.latitude)]
          }
      });
      //console.log(req.body.longitude);
      //console.log(req.body.latitude);
      Driver.save(function(err){
          if(err) console.log(err);
          console.log('User saved successfully!');
      });
  });
  </code></pre>
  
  <p>However longitudes and latitudes are not saved in loc object.</p>
  
  <p>My returned object in postman looks like this :</p>
  
  <pre><code> {
          "_id": "55773165dda03a9c14cb8468",
          "carNumber": "KA51B7499",
          "DriverName": "Jagdeesh",
          "__v": 0
      },
  </code></pre>