Skip to content

Instantly share code, notes, and snippets.

@JakubOboza
Created July 7, 2011 21:39
Show Gist options
  • Save JakubOboza/1070609 to your computer and use it in GitHub Desktop.
Save JakubOboza/1070609 to your computer and use it in GitHub Desktop.
Mongodb Geospital Index
/* Adding index */
db.places.ensureIndex( { loc : "2d" } )
/* How location array can look like */
{ loc : [ 50 , 30 ] }
{ loc : { x : 50 , y : 30 } }
{ loc : { foo : 50 , y : 30 } }
{ loc : { long : 40.739037, lat: 73.992964 } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment