Skip to content

Commit 0dd74a0

Browse files
Update source/reference/operator/aggregation/geoNear.txt
Co-authored-by: jeff-allen-mongo <[email protected]>
1 parent 0648ffc commit 0dd74a0

File tree

2 files changed

+19
-16
lines changed

2 files changed

+19
-16
lines changed

source/includes/geospatial-places-data-setup.rst

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,24 @@ Create a collection ``places`` with the following documents:
22

33
.. code-block:: javascript
44
5-
db.places.insert( {
6-
name: "Central Park",
7-
location: { type: "Point", coordinates: [ -73.97, 40.77 ] },
8-
category: "Parks"
9-
} );
10-
db.places.insert( {
11-
name: "Sara D. Roosevelt Park",
12-
location: { type: "Point", coordinates: [ -73.9928, 40.7193 ] },
13-
category: "Parks"
14-
} );
15-
db.places.insert( {
16-
name: "Polo Grounds",
17-
location: { type: "Point", coordinates: [ -73.9375, 40.8303 ] },
18-
category: "Stadiums"
19-
} );
5+
db.places.insertMany(
6+
[
7+
{
8+
name: "Central Park",
9+
location: { type: "Point", coordinates: [ -73.97, 40.77 ] },
10+
category: "Parks"
11+
} ,
12+
{
13+
name: "Sara D. Roosevelt Park",
14+
location: { type: "Point", coordinates: [ -73.9928, 40.7193 ] },
15+
category: "Parks"
16+
} ,
17+
{
18+
name: "Polo Grounds",
19+
location: { type: "Point", coordinates: [ -73.9375, 40.8303 ] },
20+
category: "Stadiums"
21+
}
22+
])
2023
2124
The following operation creates a ``2dsphere`` index on the
2225
``location`` field:

source/reference/operator/aggregation/geoNear.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ Maximum Distance
220220

221221
.. include:: /includes/extracts/4.2-changes-geoNear-limit.rst
222222

223-
Consider the ``places`` collection above, it has a ``2dsphere`` index.
223+
The ``places`` collection above has a ``2dsphere`` index.
224224
The following aggregation uses :pipeline:`$geoNear` to find documents
225225
with a location at most 2 meters from the center
226226
``[ -73.99279 , 40.719296 ]`` and ``category`` equal to ``Parks``.

0 commit comments

Comments
 (0)