Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-58443

Allow $near/$nearSphere on a view

    • Type: Icon: New Feature New Feature
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Query Optimization
    • 163

      In view resolution we need to translate all the parts of a .find() query into equivalent aggregation stages.  Currently $near and $nearSphere aren't supported on views because syntactically they're part of the .find() predicate, which becomes a $match, but semantically they also sort the results, which $match can't.

      We should be able to translate any .find() predicate to a combination of $geoNear and $match stages.  We'll need to make $geoNear's 'distanceField' argument optional.

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            david.percy@mongodb.com David Percy
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: