mongodb-erlang
mongodb-erlang copied to clipboard
how to use command with this driver with geoNear query?
mongodb office command lilke below:
db.runCommand( {
geoNear:
how to do the same with mongodb-erlang driver?
Use this as a selector : { '$near' , { '$geometry', { 'type', <<"Point">>, 'coordinates', [Latt, Long] } , '$maxDistance', Max} }
If the "Max" here instead were to be defined by a property in the document (as being discussed for instance here: https://stackoverflow.com/questions/35329898/how-to-use-a-document-property-for-maxdistance-in-a-nearsphere-query). Would there still be a way to make such a query with mongodb-erlang? The "aggregate" function is not exposed, am I right?