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

my $geonear function is not returning the expected

    XMLWordPrintableJSON

Details

    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

            eric.sedor@mongodb.com Eric Sedor
            shubh421 Shubhanshu Soni
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: