Following is my schema for Location collection:
var LocationSchema = new Schema({
street : {type: String, required: true},
area : {type: String, required: true},
city : {type: String, required: true},
state : {type: String, required: true},
zip : {type: String, required: true},
country : {type: String, default: 'IN'},
pointers:{type: [], index: '2dsphere'}
});
While saving data in mongo using mongoose pointers are store as string not as number. Got following response:
"street": "rani sati marg",
"area": "malad east",
"city": "mumbai",
"state": "maharashtra",
"zip": "400097",
"pointers": [
"72.857452,19.857452"
],
"country": "IN"
I want pointer values in number like: [72.857452,19.857452]