Hello, I created a view containing some places with location, then I need to execute a geoNear pipeline on the view, to find the near places. From the guideline at https://docs.mongodb.com/manual/core/views/#:~:text=Views%20are%20computed%20on%20demand,not%20support%20operations%20such%20as%3A&text=%24geoNear%20pipeline%20stage. it seems view doesn’t support geoNear because “Views are computed on demand during read operations, and MongoDB executes read operations on views as part of the underlying aggregation pipeline…” I am still not quite clear about the explanation, why I can’t execute the geoNear pipeline on a view? and is there any workaround solution? My view is created by a pipeline, i.e. pipeline Pa, if I copy the pipeline Pa in my search function, and add the operation of geoNear as new stage to the pipeline Pa, then I have pipeline Pb, will Pb work? If it can work, I don’t understand why the geoNear will not work on a view which is a result of the Pa?
Thanks,
James