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

    XMLWordPrintable

    Details

    • Type: Question
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Incomplete
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Geo
    • Labels:
      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

            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: