1
創建索引我在集合中創建了蒙戈本文件3.0.5蒙戈3.0.5 - 不能在多邊形
db.s.insert({_id: "Poly1", shape: {type: "Polygon", coordinates: [[ [3,1], [1,2], [5,6], [9,2], [4,3], [3,1] ]] } })
然後我嘗試在它
db.s.createIndex({"shape.coordinates" : "2dsphere"}, {bits:26});
創建2dshere指數,然後給我這個錯誤
"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",