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

    • Type: Icon: Question Question
    • Resolution: Incomplete
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Geo
    • Labels:
      None

      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}

      ]}]}]});}}

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

              Created:
              Updated:
              Resolved: