fakemongo / fongo

faked out in-memory mongo for java
Apache License 2.0
523 stars 155 forks source link

$centerSphere doesn't seem to be supported #368

Open adevore3 opened 5 years ago

adevore3 commented 5 years ago

When using fongo I can verify that data is there if I use a MultiPolygon to simulate a sphere, by building a box, but when I run the centerSphere query I get no results. I increased the radius to make sure I wasn't barely missing the location either. Below are the 2 queries.

Returns results: db.collection.find({ "loc" : { "$geoWithin" : { "$geometry" : { "type" : "MultiPolygon" , "coordinates" : [ [ [ [ -100.576294 , 62.081173] , [ -144.09404 , 62.081173] , [ -144.09404 , 33.134853] , [ -100.576294 , 33.134853] , [ -100.576294 , 62.081173]]]]}}}}).count(); 3414

Doesn't return results: db.collection.find({ "loc" : { "$geoWithin" : { "$centerSphere" : [ [ -122.33517 , 47.608013] , 0.2526042679057209]}}}).count();