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

my $geonear function is not returning the expected

    XMLWordPrintable

    Details

    • Type: Question
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Done
    • Affects Version/s: 3.4 Required
    • Fix Version/s: None
    • Labels:
      None

      Description

      my $geonear function is not returning the expected array of nearest driver in my collection.

      i am running these queries to get the result.

      to create indexes for geonear i used:

      db.dectar_drivers.createIndex({point:"2dsphere"});

      to find the nearest driver i have used:

      db.dectar_drivers.aggregate([
      {
      $geoNear: {
      near: { type: "Point", coordinates: [ 22.7323132 ,75.8753951] },
      distanceField: "total_mileage",
      maxDistance: 200,
      includeLocs: "loc",
      num: 5,
      spherical: true
      }
      }
      ])

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: