mongodb 2.4.3 出现以下错误
Can't extract geo keys from object, malformed geometry?
{type: "Polygon",
coordinates: [
[
[
103.8324334524412,
1.284232321447769
],
[
103.8342325475588,
1.284232321447769
],
[
103.8342325469261,
1.282433678236006
],
[
103.8324334530738,
1.282433678236006
]
]
]}
有人可以帮我理解这个问题吗?它看起来像一个有效的 geoJSON 对象。我的索引是类型2dsphere
。
我正在运行的两个步骤是:
collection.ensureIndex {'geometry' : "2dsphere"}, (error) =>
# some error checking
# and then
collection.insert features, (error) =>
# features is an array of geoJSON feature objects
# {"type" : "Feature"
# "geometry" : <the Polygon object above>
}
插入查询给出了这个错误。我要插入的完整文档是:
{
"type":"Feature",
"geometry": {
"type":"Polygon",
"coordinates":[
[
[103.83243345244122,1.2842323214477689],
[103.83423254755876,1.2842323214477689],
[103.83423254692615,1.2824336782360055],
[103.83243345307383,1.2824336782360055]
]
]
},
"properties":{"name" : "My location"}
}