Does applying a 2dsphere index on a mongoose schema force the location field to be required?

后端 未结 4 605
长发绾君心
长发绾君心 2020-12-15 23:17

I have a mongoose schema and model defined as follows:

var mongoose = require(\'mongoose\')
  , Schema = new mongoose.Schema({
      email: {
        index:          


        
4条回答
  •  不思量自难忘°
    2020-12-15 23:50

    The only way I have resolved this issue was changing the index type from

    GEO:{
        type: [Number],
        index: '2dsphere'
    }
    

    to

    GEO:{
        type: [Number],
        index: '2d'
    }
    

    It was a nightmare

提交回复
热议问题