【发布时间】:2015-11-10 13:31:24
【问题描述】:
我在 Mongo 3.0.5 的集合中创建了这个文档
db.s.insert( {_id: "Poly1", shape: {type: "Polygon", coordinates: [[ [3,1], [1,2], [5,6], [9,2], [4,3], [3,1] ]] } })
然后我尝试在其上创建一个 2dshere 索引
db.s.createIndex({"shape.coordinates" : "2dsphere"}, {bits:26});
然后给我这个错误
"errmsg" : "exception: Can't extract geo keys: { _id: \"Poly1\", shape: { type: \"Polygon\", coordinates: [ [ [ 3.0, 1.0 ], [ 1.0, 2.0 ], [ 5.0, 6.0 ], [ 9.0, 2.0 ], [ 4.0, 3.0 ], [ 3.0, 1.0 ] ] ] } } Point must only contain numeric elements",
【问题讨论】:
标签: mongodb indexing geospatial