title: MongoDB lat long search with 2D sphere indexing in Java application
body: <p>I have a case where I need to search nearby merchants of the logged in Users's location.
  The user's current city's lat long to be used for comparison with the Merchant data stored in our database which is like this -</p>
  
  <p>{ "merchant_id" : "W234FDHDF##234", "location" : { <strong>"loc" : {"lat" : -58.4,"lng" : 30.8}</strong>,"city" : "Cupertino" , "display_address" : [ "20956 W Homestead Rd" , "Cupertino, CA 95015"] , "postal_code" : "95015" , "country_code" : "US" , "address" : [ "20956 W Homestead Rd"] , "state_code" : "CA"} }</p>
  
  <p>I am new to MongoDB and do not have much idea about it. I am using mongodb API for our Java application.
  Can someone provide a guidance how to implement this in Java ?</p>