I am trying to find the distance between two location P(x,y) and Q(a,b) in Java using MongoDB.
I am passing x,y that is latitude and longitude from my application and i get a,b as the nearest point, now what i am looking only distance between these two points. Somewhere i read geoNear support this, but i don't find Java code for geoNear, i got only commond which i can run on MongoDB command prompt.
Please let me know how to get distance calculation in Java Using MongoDB.
Thanks