> This page location: /docs.md > /docs/development.md > /docs/v7.0/reference/mql.md > /docs/v7.0/reference/mql/query-predicates.md > /docs/v7.0/reference/mql/query-predicates/geospatial.md

> For the complete MongoDB documentation index, see www.mongodb.com/docs/llms.txt

# $geoIntersects (query predicate operator)

## Definition

Selects documents whose geospatial data intersects with a specified [GeoJSON](https://www.mongodb.com/docs/v7.0/reference/geojson.md#std-label-geospatial-indexes-store-geojson) object; i.e. where the intersection of the data and the specified object is non-empty.

The [`$geoIntersects`](https://www.mongodb.com/docs/v7.0/reference/operator/query/geointersects.md#mongodb-query-op.-geoIntersects) operator uses the [`$geometry`](https://www.mongodb.com/docs/v7.0/reference/operator/query/geometry.md#mongodb-query-op.-geometry) operator to specify the [GeoJSON](https://www.mongodb.com/docs/v7.0/reference/geojson.md#std-label-geospatial-indexes-store-geojson) object. To specify a GeoJSON polygons or multipolygons using the default coordinate reference system (CRS), use the following syntax:

```javascript
{
  <location field>: {
     $geoIntersects: {
        $geometry: {
           type: "<GeoJSON object type>" ,
           coordinates: [ <coordinates> ]
        }
     }
  }
}
```

For [`$geoIntersects`](https://www.mongodb.com/docs/v7.0/reference/operator/query/geointersects.md#mongodb-query-op.-geoIntersects) queries that specify GeoJSON geometries with areas greater than a single hemisphere, the use of the default CRS results in queries for the complementary geometries.

A complementary geometry is the smaller of two geometries. If a specified geometry covers more than a hemisphere, the default CRS query returns documents for the complementary geometry.

For example, if you define a geometry to be an area covering 75% of Earth's surface, CRS uses the remaining 25% as the complementary area. The query returns results from that smaller complementary 25% area instead of the larger 75%.

The [Examples](https://www.mongodb.com/docs/v7.0/reference/operator/query/geointersects.md#std-label-geointersects-examples) section on this page shows how to specify smaller and larger areas.

To specify a single-ringed GeoJSON [polygon](https://www.mongodb.com/docs/v7.0/reference/geojson.md#std-label-geojson-polygon) with a custom MongoDB CRS, use the following prototype that specifies the custom MongoDB CRS in the [`$geometry`](https://www.mongodb.com/docs/v7.0/reference/operator/query/geometry.md#mongodb-query-op.-geometry) expression:

```javascript
{
  <location field>: {
     $geoIntersects: {
        $geometry: {
           type: "Polygon" ,
           coordinates: [ <coordinates> ],
           crs: {
              type: "name",
              properties: { name: "urn:x-mongodb:crs:strictwinding:EPSG:4326" }
           }
        }
     }
  }
}
```

The custom MongoDB CRS uses a counter-clockwise winding order and allows [`$geoIntersects`](https://www.mongodb.com/docs/v7.0/reference/operator/query/geointersects.md#mongodb-query-op.-geoIntersects) to support queries with a single-ringed GeoJSON [polygon](https://www.mongodb.com/docs/v7.0/reference/geojson.md#std-label-geojson-polygon) whose area is greater than or equal to a single hemisphere. If the specified polygon is smaller than a single hemisphere, the behavior of [`$geoIntersects`](https://www.mongodb.com/docs/v7.0/reference/operator/query/geointersects.md#mongodb-query-op.-geoIntersects) with the MongoDB CRS is the same as with the default CRS. See also ["Big" Polygons.](https://www.mongodb.com/docs/v7.0/reference/operator/query/geointersects.md#std-label-geointersects-big-poly)

**Important:**

If specifying latitude and longitude coordinates, list the **longitude** first, and then **latitude**.

- Valid longitude values are between `-180` and `180`, both inclusive.

- Valid latitude values are between `-90` and `90`, both inclusive.

## Behavior

### Geospatial Indexes

[`$geoIntersects`](https://www.mongodb.com/docs/v7.0/reference/operator/query/geointersects.md#mongodb-query-op.-geoIntersects) uses spherical geometry. [`$geoIntersects`](https://www.mongodb.com/docs/v7.0/reference/operator/query/geointersects.md#mongodb-query-op.-geoIntersects) does not require a geospatial index. However, a geospatial index will improve query performance. Only the [2dsphere](https://www.mongodb.com/docs/v7.0/core/indexes/index-types/geospatial/2dsphere.md#std-label-2dsphere-index) geospatial index supports [`$geoIntersects`.](https://www.mongodb.com/docs/v7.0/reference/operator/query/geointersects.md#mongodb-query-op.-geoIntersects)

### Degenerate Geometry

[`$geoIntersects`](https://www.mongodb.com/docs/v7.0/reference/operator/query/geointersects.md#mongodb-query-op.-geoIntersects) does not guarantee that it will consider a polygon to intersect with its own edges; its own vertices; or another polygon sharing vertices or edges but no interior space.

### "Big" Polygons

For [`$geoIntersects`](https://www.mongodb.com/docs/v7.0/reference/operator/query/geointersects.md#mongodb-query-op.-geoIntersects), if you specify a single-ringed polygon that has an area greater than a single hemisphere, include the custom MongoDB coordinate reference system in the [`$geometry`](https://www.mongodb.com/docs/v7.0/reference/operator/query/geometry.md#mongodb-query-op.-geometry) expression. Otherwise, [`$geoIntersects`](https://www.mongodb.com/docs/v7.0/reference/operator/query/geointersects.md#mongodb-query-op.-geoIntersects) queries for the complementary geometry. For all other GeoJSON polygons with areas greater than a hemisphere, [`$geoIntersects`](https://www.mongodb.com/docs/v7.0/reference/operator/query/geointersects.md#mongodb-query-op.-geoIntersects) queries for the complementary geometry.

## Examples

### Intersects a Polygon

The following example uses [`$geoIntersects`](https://www.mongodb.com/docs/v7.0/reference/operator/query/geointersects.md#mongodb-query-op.-geoIntersects) to select all `loc` data that intersect with the [`Polygon`](https://www.mongodb.com/docs/v7.0/reference/geojson.md#std-label-geojson-polygon) defined by the `coordinates` array. The area of the polygon is less than the area of a single hemisphere:

```javascript
db.places.find(
   {
     loc: {
       $geoIntersects: {
          $geometry: {
             type: "Polygon" ,
             coordinates: [
               [ [ 0, 0 ], [ 3, 6 ], [ 6, 1 ], [ 0, 0 ] ]
             ]
          }
       }
     }
   }
)
```

For single-ringed polygons with areas greater than a single hemisphere, see [Intersects a "Big" Polygon.](https://www.mongodb.com/docs/v7.0/reference/operator/query/geointersects.md#std-label-geointersects-big-polygon)

### Intersects a "Big" Polygon

To query with a single-ringed GeoJSON polygon whose area is greater than a single hemisphere, the [`$geometry`](https://www.mongodb.com/docs/v7.0/reference/operator/query/geometry.md#mongodb-query-op.-geometry) expression must specify the custom MongoDB coordinate reference system. For example:

```javascript
db.places.find(
   {
     loc: {
       $geoIntersects: {
          $geometry: {
             type : "Polygon",
             coordinates: [
               [
                 [ -100, 60 ], [ -100, 0 ], [ -100, -60 ], [ 100, -60 ], [ 100, 60 ], [ -100, 60 ]
               ]
             ],
             crs: {
                type: "name",
                properties: { name: "urn:x-mongodb:crs:strictwinding:EPSG:4326" }
             }
          }
       }
     }
   }
)
```
