检测到循环依赖(MongoDB Atlas 索引)
Cyclic dependency detected (MongoDB Atlas Index)
我使用 Python 创建了一个 MongoDB 数据库,现在想为地理空间查询的位置字段设置索引。位置字段如下所示
location{type:"Point", coordinates :[lat, lng]}
每当我尝试使用 MongoDB Atlas 在位置字段上创建索引时,我总是收到上述错误。
问题已解决。我在坐标中将 lat, lng 更改为 lng, lat 并且有效。
我使用 Python 创建了一个 MongoDB 数据库,现在想为地理空间查询的位置字段设置索引。位置字段如下所示
location{type:"Point", coordinates :[lat, lng]}
每当我尝试使用 MongoDB Atlas 在位置字段上创建索引时,我总是收到上述错误。
问题已解决。我在坐标中将 lat, lng 更改为 lng, lat 并且有效。