I have a mongoose schema and model defined as follows:
var mongoose = require(\'mongoose\') , Schema = new mongoose.Schema({ email: { index:
For mongoose 3.8.12, you set the default value:
var UserSchema = new Schema({ location: { type: { type: String, enum: ['Point'], default: 'Point', }, coordinates: { type: [Number], default: [0, 0], } } }); UserSchema.index({location: '2dsphere'});