我在mongodb中有存储文档,其中包含:
{
"Latitude" : "1.242",
"Longitude" : "-12.311"
}
没错,它们是字符串!我该如何将它们转换为 double 类型并存储为 GeoJSON 点,即:
{
"Coordinates" = [-12.311,1.242]
}
我希望能够执行类似于地理空间查询的操作。
"$and":[{"Latitude" : { "$not" : { "$within" : { "$center" : [[lat,lon]],1000] } } }},{"Longitude" : { "$not" : { "$within" : { "$center" : [[lat,lon],1000] } } }}]
一个查询如下形式:
Mongodb not $near
查找所有不在由lat lon形成的半径为1000米的圆内的点。如果可以不进行更改就完成此操作,请提供其他建议。请帮忙!