location object expected, location array not in correct format

后端 未结 1 1342
没有蜡笔的小新
没有蜡笔的小新 2021-02-15 15:38

I have spent doing such a straight forward thing. I just want to do a CRUD operation on a user model using nodejs, mongoose, restify stack. My mongo instance is on mongolab. Th

相关标签:
1条回答
  • 2021-02-15 15:57

    MongoDB 2d index requires the legacy coordinates pairs format, which is just an array of coordinates like [1, 2].

    If you need GeoJSON support, please use the 2dsphere index.

    userSchema.index({loc:'2dsphere'});
    
    0 讨论(0)
提交回复
热议问题