-
Book Overview & Buying
-
Table Of Contents
Node.js 6.x Blueprints.
By :
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, $geometry, and others, to locate certain records in a map that are next to a particular location.
In this chapter we will cover the following topics:
Creating models/schema to store coordinates in MongoDB
Creating 2dspheres indexes
Dealing with the Google...