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

planner returned error: unable to find index for $geoNear query at Connection Ask Question

    XMLWordPrintableJSON

Details

    • Question
    • Status: Closed
    • Major - P3
    • Resolution: Incomplete
    • None
    • None
    • Geo
    • None

    Description

      I haven't use the $geoNear in my query instead I have used $near. But this is showing the error of $geoNear. And the error create the interruption in processing the query. Not always but once in every hour.
      I have used '2dsphere' index already---

      scheduleRideSchema.index({ source: '2dsphere' });
       
      {{ $or: [{ $or: [{ $and: [{ pickupStart:

      { $gte: pickupStartTime }

      }, { pickupEnd:

      { $lte: pickupStartTime }

      }] },{ $and: [{ pickupStart:

      { $gte: pickupStartTime }

      }, { pickupEnd:

      { $lte: pickupEndTime }

      }] }]}, { $or: [{ $and: [{ pickupStart:

      { $lte: pickupStartTime }

      }, { pickupEnd:

      { $gte: pickupStartTime }

      }] },{ $and: [{ pickupStart:

      { $lte: pickupStartTime }

      }, { pickupEnd:

      { $gte: pickupEndTime }

      }] }]}]}, { $and:[{ source:{ $near:{ $geometry:

      { type: "Point", coordinates: sourceCord.coordinates }

      , $maxDistance: 4000}}},{$and:[

      {cancel:false}

      ,

      { complete:false}

      ]}]}]});}}

      Attachments

        Activity

          People

            dmitry.agranat@mongodb.com Dmitry Agranat
            shibu.siddharth@gmail.com Siddhartha Singh
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: