Skip to Main Content

MongoByte MongoDB Logo

Welcome to the new MongoDB Feedback Portal!

{Improvement: "Your idea"}
We’ve upgraded our system to better capture and act on your feedback.
Your feedback is meaningful and helps us build better products.

Status Submitted
Categories Atlas Search
Created by Guest
Created on Nov 8, 2021

geoWithin metadata reporting searchDistance

Using geoWithin in the $search aggregation pipeline lets me use the search indexes, but it doesn't let me see the distance. I'd love to have a distanceField or perhaps a $meta that reports searchDistance similar to the one we have for searchScore
  • Guest
    Jul 26, 2023
    For reference - https://www.mongodb.com/community/forums/t/calculating-distance-in-atlas-search/196134/4
  • Guest
    Mar 3, 2023
    For my use case I need to search data based on location and text, and be able to sort it by proximity. If this features is not implemented, I need to either split the query into two, to perform a search and then pass the results to a $geoWithin filtering by the IDs of the previous pipeline, or, to query for all items that match the search and geo restrictions and then calculate proximity on server, having to transfer a lot of unnecessary data.