我试图保存经纬度mongoose模型,但我无法存储它们

这是我的mongoose模型

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' } }); 

我试图从postman发布经纬度是:

 carNumber KA51B7499 DriverName Sachin longitude 74.9999 latitude 67.2563 

我在下面的代码中将这个请求保存在mongoose中:

 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!'); }); }); 

然而经纬度并没有保存在loc对象中。

我在邮递员的返回对象看起来像这样:

  { "_id": "55773165dda03a9c14cb8468", "carNumber": "KA51B7499", "DriverName": "Jagdeesh", "__v": 0 }, 

       

网上收集的解决方案 "我试图保存经纬度mongoose模型,但我无法存储它们"