Skip to content

Commit 8358cd9

Browse files
Fix geo links (#167)
Fix-Geo-Links
1 parent 647246f commit 8358cd9

File tree

1 file changed

+20
-11
lines changed
  • source/fundamentals/crud/read-operations

1 file changed

+20
-11
lines changed

source/fundamentals/crud/read-operations/geo.txt

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,17 @@ Search Geospatially
44

55
.. default-domain:: mongodb
66

7+
.. contents:: On this page
8+
:local:
9+
:backlinks: none
10+
:depth: 2
11+
:class: singlecol
12+
713
Overview
814
--------
915

1016
You can query data based on geographical location using geospatial query
11-
operators. Geospatial queries can be formatted using one of the following
17+
operators. You can format geospatial queries using one of the following
1218
coordinate systems:
1319

1420
- :ref:`Coordinates on an Earth-like Sphere <sphere>`
@@ -24,7 +30,7 @@ Coordinates on an Earth-like Sphere
2430

2531
For geospatial queries using longitude and latitude coordinates
2632
on an Earth-like sphere, use the :manual:`GeoJSON
27-
</geospatial-queries/index.html#geospatial-geojson>`
33+
</geospatial-queries/#geojson-objects>`
2834
query format. While GeoJSON has :manual:`multiple types
2935
</reference/geojson/>`, all GeoJSON data
3036
types use some form of the following structure:
@@ -50,11 +56,11 @@ about the GeoJSON shapes you can use in MongoDB, consult the
5056

5157
To enable querying GeoJSON data, you must add the field to a ``2dsphere``
5258
index. The following snippet creates an index on the ``location.geo`` field in
53-
the ``movies`` collection using the ``createIndex()`` method:
59+
the ``theaters`` collection using the ``createIndex()`` method:
5460

5561
.. code-block:: javascript
5662

57-
db.movies.createIndex({location.geo: "2dsphere"})
63+
db.theaters.createIndex({location.geo: "2dsphere"})
5864

5965
.. _plane:
6066

@@ -76,7 +82,7 @@ The field should contain an array of two values in which the first represents
7682
the ``x`` axis value and the second represents the ``y`` axis value.
7783

7884
To enable querying using legacy coordinate pairs, create a ``2d`` index on
79-
the field on the collection. The following snippet creats an index on the
85+
the field on the collection. The following snippet creates an index on the
8086
``coordinates`` field in the ``shipwrecks`` collection using the
8187
``createIndex()`` method:
8288

@@ -85,27 +91,30 @@ the field on the collection. The following snippet creats an index on the
8591
db.shipwrecks({coordinates: "2d"})
8692

8793
See the
88-
:manual:`MongoDB server manual page on legacy coordinate pairs </geospatial-queries/index.html#legacy-coordinate-pairs>`
94+
:manual:`MongoDB server manual page on legacy coordinate pairs </geospatial-queries/#legacy-coordinate-pairs>`
8995
for more information.
9096

9197
.. note::
9298

9399
Spherical (``2dsphere``) and flat (``2d``) indexes support some, but
94100
not all, of the same query operators. For a full list of operators
95101
and their index compatibility, consult the
96-
:manual:`manual entry for geospatial queries </geospatial-queries/index.html#geospatial-models>`.
102+
:manual:`manual entry for geospatial queries </geospatial-queries/#geospatial-query-operators>`.
97103

98104
Examples
99105
--------
100106

101-
The following examples use the ``theaters`` collection of the
102-
``sample_mflix`` sample database available in MongoDB Atlas, with a
103-
``2dsphere`` index on the ``location.geo`` field.
107+
The following examples use the MongoDB Atlas sample dataset. You can learn how to set up your own free-tier Atlas cluster and how to load the sample dataset in our
108+
:doc:`quick start guide </quick-start>`.
109+
110+
The examples use the ``theaters`` collection in the ``sample_mflix`` database
111+
from the sample dataset. The ``theaters`` collection contains a ``2dsphere`` index
112+
on the ``location.geo`` field.
104113

105114
Query by Proximity
106115
~~~~~~~~~~~~~~~~~~
107116

108-
The :manual:`$near </reference/operator/query/near/#op._S_near>`
117+
The :manual:`$near </reference/operator/query/near/#mongodb-query-op.-near>`
109118
operator accepts a set of longitude-latitude coordinates and returns
110119
documents ordered from nearest to farthest. To limit the results to a
111120
maximum distance in meters, use the ``$maxDistance`` option. For a

0 commit comments

Comments
 (0)