Would like to know how to filter a Firestore collection of docs using a function where some of the function args are the values of the collection documents.
Suppose had
There is no way to pass a function into Cloud Firestore that it then uses to filter the documents that it returns. You either need to pass in static values (e.g. the latitude and longitude you want back), or you will need to read all documents and filter with the function client-side.
What you're trying to do is known as a geoquery: returning documents based on their distance to a known point. Unfortunately that functionality is not built into Cloud Firestore yet, even though it has support for a geographical point data type. It is possible to build it yourself, though you should realize such queries are quite inefficient at the moment.
To learn more about this: