Let’s say that some documents have GeoJSON / LineString fields that represent someone’s displacement. The coordinates that make up the LineString were brought from the google map api.
There is currently no inbuilt function to calculate the distance between two arbitrary geo locations in the same document, but there are well-known algorithms such as haversine that you could use.
The most straightforward approach would be to use an existing Python library (for example: haversine), but you should also be able to implement this using trigonometry operators in an aggregation pipeline.