我try 用以下内容准备我的数据库字段进行地理编码:
MyCollection._ensureIndex({'data.address.located':'2dsphere'});
但是这个错误来了:
MongoError: Can't extract geo keys from object, malformed geometry?:
{ type: "Point", coordinates: [ 32.4586858, -110.8571443 ] }
我看不出这个领域有什么问题?知道吗?
当我查看this时,它显示如下:
The following example stores a GeoJSON Point:
{ loc: { type: "Point", coordinates: [ 40, 5 ] } }