You are previewing MongoDB in Action.

MongoDB in Action

Cover of MongoDB in Action by Kyle Banker Published by Manning Publications
O'Reilly logo

Appendix E. Spatial indexing

With the proliferation of smart mobile devices, the demand for location-based services has been increasing steadily. To build these location-dependent applications requires a database capable of indexing and querying spatial data. This feature was added to the MongoDB road map fairly early on, and MongoDB’s spatial indexing, though not as fully featured as, say, PostGIS, nevertheless now powers the location queries for a number of popular sites.[1]

1 The most prominent of these is Foursquare ( You can learn more about Foursquare’s MongoDB usage at

As the name implies, spatial indexes are optimized for data representing locations. In the case of MongoDB, this data is typically ...

The best content for your career. Discover unlimited learning on demand for around $1/day.