$geoWithin and $centerSphere with dynamic radius

That is correct. :smiley:

That is what I need in this case though. Both static and dynamic use cases are useful, and I just though that this can be dynamic inside aggregate.

Another way to solve this is to add new property field where I would calculate distance for each document, and then add another stage where I would compare new distance field with proximity field. But, I don’t know how to calculate the distance. Do you happen to know how do to it?

I created this post for it, so please add solution there if you know the solution. :smiley: