Calculating distance in Atlas Search

Hi Pavel,

Following up on this, I gave it a try but the problem is that the score for my searches is a combination of the scores for different clauses (not only the “near” operator in Atlas search). I don’t see any way I can extract the score just for “near”. I ended up calculating the distance using longitude and latitude in my app (rather than the database), which comes up pretty accurate. This does not completely meet my use case as I am not able to do a pure distance sort on the database (I can do it in the app, but that would mean getting all the results from the db, doing the sort and then getting the relevant page of the results). If the search is purely on distance, Mongo sorts automatically, but I cannot rely on this when the search includes other parameters. I think it would be good to expose the distance calculated by Mongo in the API (since it is done anyway by Mongo when using near or geoWithin in Atlas search).

Thanks very much for loking into this.

Kind regards,
Gueorgui