Here, I have different tables firestore but calculating distance from two tables namely Driver_details and Current_booking from firestore. In firestore driver_details table looks like Driver_details -> City(like bangalore, chennai, etc) -> SubLocality(like st.thomas, rajivi street, etc) -> Driver document id -> parameter value(contains: lat, long, name, id, etc..) and Current_booking table looks like Current_booking -> document id -> parameter value(Start_lat, Start_long, etc..).
How can i calculate distance of driver_detaisl -> city -> sublocality and Current_booking of lat long and then filter location driver which is nearest user lat long
Here is the screenshots of my firestore db: