Marking documentation changes as needed because this finally gets rid of the geoNear command. Use the $geoNear aggregation stage instead.
In the old geoNear command, there used to be fields that kept track of the total distance seen and the maximum distance seen. The $geoNear agg stage doesn't keep track of that for you automatically, but it's possible with the agg framework. I think this is a worthy example to have in the docs in case someone is wondering how to get the exact same behavior as the old command.
Engineering Ticket Description:
The geoNear command was deprecated for MongoDB 4.0. We will remove completely under this ticket.
Since the $geoNear aggregation stage is internally implementing by issuing a geoNear command through the DBDirect client, work here will include re-implementing the $geoNear aggregation stage.