With MongoDB you can store Geospatial Information i.e. information about location in co-ordinates, longitude and latitude etc. MongoDB allows you to create indexes on Geospatial data.
MongoDB supports two type of Geospatial Index. But, MongoDB allows only one Geospatial Index per collection (table).
1. 2d Indexes
2. 2sphere Indexes
2d Indexes: When the data is stored as legacy coordinate pairs to support planar geometry in the fields, MongoDB allows to create 2d Indexes. To create a 2d sphere Index the syntax is following:
db.Collection_name.ensureIndex({location_field}: “2d”, additional_field: value}, {index-specification options})
2d Sphere Indexes: When the data is stored to support spherical geometry as longitude and latitude in the fields, MongoDB allows to create 2d Sphere Indexes. To create a 2d sphere Index the syntax is following:
Db.Collection_name.ensureIndex({location_field}: “2dsphere”})
How to get Started with MongoDB
How to create or drop Database in MongoDB?
How to create Collection (Table) in MongoDB?
... More