0
我在我的地點集合中有以下行。
{ "_id" : ObjectId("572b3892967c76c62b7f63e3"), "loc" : { "type" : "Point", "coordinates" : [ -73.97, 40.77 ] }, "name" : "Central Park", "category" : "Parks" }
{ "_id" : ObjectId("572b38ba967c76c62b7f63e4"), "loc" : { "type" : "Point", "coordinates" : [ -73.88, 40.78 ] }, "name" : "La Guardia Airport", "category" : "Airport" }
我不能執行下面的查詢
db.places.find({$nearSphere: {$geometry: { type: "Point", coordinates: [-73.92, 40.775]}, $minDistance: 10000, $maxDistance: 10}})
我獲得以下錯誤: Error: error: { "$err" : "Can't canonicalize query: BadValue unknown top level operator: $nearSphere", "code" : 17287 }
請讓我知道什麼是問題。