In order to conduct geospatial queries, you must specify one or more pairs of coordinates. For real-world data, this often translates into latitude and longitude. Before you go too much further, however, you need to stop and carefully consider what sorts of geospatial queries you plan to perform. Although all current MongoDB geospatial queries involve one or more sets of two-dimensional X,Y coordinates, there are two radically different models available: flat and spherical.
We begin our discussion by covering the flat 2D model, which performs queries on legacy coordinate pairs (for example, latitude and longitude).