From 5b61a359ac3d2eee3d35531ffc974674f39c204a Mon Sep 17 00:00:00 2001 From: sallyx Date: Wed, 6 Apr 2016 14:07:17 +0200 Subject: [PATCH] Fixed creating neighborhoods index The neighborhoods document structure looks like {"_id": ..., "geometry" : { "coordinates": [ ...],"type" : "Polygon"},"name":"..."}} It makes more sense to create index like db.neighborhoods.createIndex({ geometry: "2dsphere" }) than db.neighborhoods.createIndex({ coordinates: "2dsphere" }) --- source/tutorial/geospatial-tutorial.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/tutorial/geospatial-tutorial.txt b/source/tutorial/geospatial-tutorial.txt index 611b4dd28b1..4982e70ff8a 100644 --- a/source/tutorial/geospatial-tutorial.txt +++ b/source/tutorial/geospatial-tutorial.txt @@ -166,7 +166,7 @@ collection using the :program:`mongo` shell: .. code-block:: javascript db.restaurants.createIndex({ location: "2dsphere" }) - db.neighborhoods.createIndex({ coordinates: "2dsphere" }) + db.neighborhoods.createIndex({ geometry: "2dsphere" }) Exploring the Data ~~~~~~~~~~~~~~~~~~