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 -
{ "merchant_id" : "W234FDHDF##234", "location" : { "loc" : {"lat" : -58.4,"lng" : 30.8},"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"} }
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 ?