Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-9596

Comment on: "manual/reference/command/geoNear.txt"

    XMLWordPrintableJSON

Details

    Description

      In my document there is a array which contain the point, below is an example:
      {
      "detail": [
      {
      "name":"jack",
      "loc":

      { "lng":113.166, "lat":23.4485 }

      },
      {
      "name":"tom",
      "loc":

      { "lng":113.163, "lat":23.447 }

      }
      ]
      }
      When I use command to search:
      db.runCommand( { geoNear:"Table1" ,
      near:

      { type: "Point" , coordinates: [113.167294, 23.447903] }

      ,
      spherical: true,
      includeLocs:true,
      uniqueDocs:true,
      maxDistance: 300
      } )
      I want "jack" to be return but "tom" because the distance between tom and [113.167294, 23.447903] is larger then 300 meters. But the command return all of them.
      How do I limit the result which is just match the condition in Array. Thanks

      Attachments

        Activity

          People

            ravind.kumar Ravind Kumar (Inactive)
            xgen-internal-docs Docs Collector User (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              45 weeks, 5 days ago