Querying near geographical locations using $geoNear with MongoDB

Hey guys,

I am currently trying to use an aggregation to add a new field ‘nearPois’ to my geo spatial datapoints (point of interests) which should hold all near point of interests in a radius of 500 meters as an embedded array. I was not able to figure out how to add dynamic coordinates to the $geoNear pipeline step. I am using a ‘location’ attribute (a geojson geometry with the attribute type “Point” and a coordinates double array with [lat, long]) with a 2dSphere-Index. Is there any way I can query this information in one larger query instead of running a for-each one every point of interest at runtime?

Kind regards
Jamie