Sokil\Mongo\Expression::intersects PHP Method

intersects() public method

Selects documents whose geospatial data intersects with a specified GeoJSON object; i.e. where the intersection of the data and the specified object is non-empty. This includes cases where the data and the specified object share an edge. Uses spherical geometry.
public intersects ( string $field, GeoJson\Geometry\Geometry $geometry ) : Expression
$field string
$geometry GeoJson\Geometry\Geometry
return Expression
    public function intersects($field, Geometry $geometry)
    {
        $this->where($field, array('$geoIntersects' => array('$geometry' => $geometry->jsonSerialize())));
        return $this;
    }