Skip to content

Instantly share code, notes, and snippets.

@adamnengland
Created May 20, 2015 17:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamnengland/e9a947f481e70dfb6d92 to your computer and use it in GitHub Desktop.
Save adamnengland/e9a947f481e70dfb6d92 to your computer and use it in GitHub Desktop.
Mongodb GI examples
Example of a working query
db.postalCode.find( { 'geo' :{ $near :{ $geometry :{ type : "Point" ,coordinates : [ -94.58, 39.09 ] } ,$maxDistance : 10000} } } );
GIS Standard: <Longitude,Latitude>
db.businesses.count( { 'geo' :{ $near :{ $geometry :{ type : "Point" ,coordinates : [ -94.595033, 39.102704 ] } ,$maxDistance : 4000} } } );
db.event.find( { 'geo' :{ $near :{ $geometry :{ type : "Point" ,coordinates : [ -94.58, 39.09 ] } ,$maxDistance : 1000} } } );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment