【发布时间】:2019-01-10 10:39:56
【问题描述】:
我使用 Python 创建了一个 MongoDB 数据库,现在想为地理空间查询的位置字段设置索引。位置字段如下所示
location{type:"Point", coordinates :[lat, lng]}
每当我尝试使用 MongoDB Atlas 在位置字段上创建索引时,我都会不断收到上述错误。
【问题讨论】:
标签: mongodb mongodb-query geospatial pymongo-3.x
我使用 Python 创建了一个 MongoDB 数据库,现在想为地理空间查询的位置字段设置索引。位置字段如下所示
location{type:"Point", coordinates :[lat, lng]}
每当我尝试使用 MongoDB Atlas 在位置字段上创建索引时,我都会不断收到上述错误。
【问题讨论】:
标签: mongodb mongodb-query geospatial pymongo-3.x
问题解决了。我将坐标中的 lat, lng 更改为 lng, lat 并且它起作用了。
【讨论】: