I'm wondering whether it is possible to calculate the distance between two points in miles and return that as an attribute of requested documents. I think this would usually be done with aggregation in MongoDB. Is something like that possible? I may just do it in the front-end if not but curious if anyone has any thoughts on the best approach for this.
two points on the same doc? You could throw together another field that is stored on that doc and then use a beforeChange hook to calc the distance and store it on your new field
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.