I try the code below in PHP in order to get two results, but it returns all results. I tested this query in mongo and it works, just in the PHP it does not work. I use the incubator library and PHP 7.1.
$query = ['location' => ['$near' => ['$geometry' => ['type' => "Point", 'coordinates' => [-23.9768691, -46.194405]], '$minDistance' => 0, '$maxDistance' => 5000] ] ]; $events = Events::find($query);
I don't know what's the problem. I did not have problems finding by text, and others. I have tried to query direct with the MongoClient object, but no success too.