Use $maxDistance as limiter when performing near queries

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: 1.6.5
    • Component/s: Geo
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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")}

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

              Created:
              Updated:
              Resolved: