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

Use $maxDistance as limiter when performing near queries

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • 1.6.5
    • Geo
    • None

    Description

      In order to support counting points within a certain distance, $maxDistance should take precedence over the current 100 result limit. To illustrate my own problem, I'd like to count how many crimes happened within a certain range of a particular point. As long as the results are below 100, this query will return the expected result, anything with more than 100 results always returns 100.

      db.crimes.count({loc:

      { $near: [-122.578997, 45.533723], $maxDistance: 0.005}

      , reported_at: {$gte: new Date("Jan 01, 2009"), $lt: new Date("Jan 01, 2010")}

      Attachments

        Activity

          People

            Unassigned Unassigned
            caged Justin Palmer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: