Chapter 5.  Creating a Store Locator Application with MongoDB Geospatial Query

In this chapter, we will build an application to store Geolocation data with coordinates (latitude and longitude) and show them on the map by only using resources of the express framework, the Google Maps API, and pure JavaScript.

It is very common nowadays to use JavaScript libraries for this purpose, but most of them are used only on the frontend of the application, often consuming an endpoint with data in JSON format and updating the UI using Ajax. But we will use only JavaScript on the backend, building a MVC application.

Also, we will use a very powerful feature from MongoDB which is the ability to generate indexes in coordinates the using operators such as $near ...

Get Node.js 6.x Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.