public function whereNear($column, array $coords, $geometry = null, $maxDistance = null, $boolean = 'first')
{
if (is_null($geometry)) {
$value = array('$near' => $coords);
if (!is_null($maxDistance)) {
$value['$maxDistance'] = $maxDistance;
}
} else {
$value = array('$near' => array('$geometry' => array('type' => $geometry, 'coordinates' => $coords)));
if (!is_null($maxDistance)) {
$value['$near']['$geometry']['$maxDistance'] = $maxDistance;
}
}
return $this->where($column, $value, $boolean);
}