Tutorial by Examples

db.collection.createIndex() method is used to create a 2dsphere index. The blueprint of a 2dsphere index : db.collection.createIndex( { <location field> : "2dsphere" } ) Here, the location field is the key and 2dsphere is the type of the index. In the following example we are goi...

Page 1 of 1