Skip to content

Commit 8e3ce73

Browse files
Update source/includes/geospatial-places-data-setup.rst
Co-authored-by: jeff-allen-mongo <[email protected]>
1 parent a2c8ff2 commit 8e3ce73

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

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

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,23 @@ 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+
name: "Central Park",
8+
location: { type: "Point", coordinates: [ -73.97, 40.77 ] },
9+
category: "Parks"
10+
},
11+
{
12+
name: "Sara D. Roosevelt Park",
13+
location: { type: "Point", coordinates: [ -73.9928, 40.7193 ] },
14+
category: "Parks"
15+
},
16+
{
17+
name: "Polo Grounds",
18+
location: { type: "Point", coordinates: [ -73.9375, 40.8303 ] },
19+
category: "Stadiums"
20+
}
21+
] )
2022
2123
The following operation creates a ``2dsphere`` index on the
2224
``location`` field:

source/reference/operator/aggregation/geoNear.txt

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

217217
.. include:: /includes/extracts/4.2-changes-geoNear-limit.rst
218218

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

0 commit comments

Comments
 (0)