$geoNear Aggregation Query Example Causing Strange Error

The issue is likely related to the order of the coordinates in the $geoNear aggregation and/or the longitude/latitude inputs being in the wrong order. According to the MongoDB documentation, the longitude should be the first value and the latitude should be the second value when querying for a GeoJSON point. Make sure that the longitude is the first value of the coordinates array when defining the location in the model and also when passing the longitude and latitude arguments in the $geoNear query.
Assisted by Doc-E.ai
Reference: node.js - mongodb - using $geoNear gives "geo near accepts just one argument when querying for a GeoJSON point" when using maxDistance - Stack Overflow