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

Allow $near/$nearSphere on a view

    XMLWordPrintableJSON

Details

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • Query Optimization
    • 163

    Description

      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.

      Attachments

        Activity

          People

            backlog-query-optimization Backlog - Query Optimization
            david.percy@mongodb.com David Percy
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: