0
我在我的數據庫中存儲了一些GeoJSON點,我無法使用新的geoWithin(2.4.1)查詢它們。MongoDB幾何查詢不起作用
下面是我收集的指標:
> db.features1.getIndexes();
[
{
"v" : 1,
"key" : {
"_id" : 1
},
"ns" : "sagedb.features1",
"name" : "_id_"
},
{
"v" : 1,
"key" : {
"geometry" : "2dsphere"
},
"ns" : "sagedb.features1",
"name" : "geometry_2dsphere"
}
]
這裏是一個文件我在我的分貝
> db.features1.find();
{
"_id" : ObjectId("51672e677a62bb0000000003"),
"geometry" : {
"type" : "Point",
"coordinates" : [ -106.8610919, 49.665165099999996 ] },
"__v" : 0 }
我試圖運行此查詢:
> db.features1.find({
geometry: {
$geoWithin: {
$geometry: {
type: "Polygon",
coordinates: [ [ [-180,-90], [-180,90], [180,90], [180,-90], [-180,-90] ] ] } } } });
但我沒有得到任何回報。任何想法我做錯了什麼?