from pymongo import GEOSPHERE
from pymongo import MongoClient
CONNECTION_STRING = "mongodb://localhost:27017"
client = pymongo.MongoClient(CONNECTION_STRING)
db = client['Chandigarh']
collection = db['LocationPoints']
db.collection.createIndex({"location":"2d"})
point1 = {'location': {'type': "Point", 'coordinates': [30.477666, -76.452333]}}
point2 = {'location': {'type': "Point", 'coordinates': [30.458333, -76.4103333]}}
collection.insert_one(point1)
collection.insert_one(point2)
###
Querying database for distance between these two points
or
Calculating distance between these two points in meters
###
I cannot see presence of such functionality in the documentation and otherwise, I am unaware of how to calculate distance between two location points.