MongoDB Count Inaccurate on Geospatial Queries
I'm querying for documents that are close to a location ($near
and $maxDistance
) and fall within a date range (an $or
with a 3 sets of $gt
/$lt
conditions relating to dates/schedules).
I find that $cursor->count()
always returns 100 even if there are 100 or more results regardless of limit()
.
It seems like $cursor->skip()->limit()
work fine, allowing me to skip more than 100 results (when there are more than 100), but it bothers me that count()
always returns 100 and there seems to be no way to determine the full count (other than paging until there are no more results).
I find references to map reduce not working correctly with geospatial, and the mongodb docs reference a default limit()
of 100.
The above query finds the closest points to (50,50) and returns them sorted by distance (there is no need for an additional sort parameter). Use limit() to specify a maximum number of points to return (a default limit of 100 applies if unspecified):
Is this a known issue? I开发者_运维技巧'm using the PHP driver.
Waiting for add $or $and support to geo-spital for a year:
Estimate: Medium ( < 1 week)
Fix Version/s: planned but not scheduled
https://jira.mongodb.org/browse/SERVER-3984
__ maybe they support this due 2014 ;) __
http://pastebin.com/raw.php?i=FD3xe6Jt
http://www.zopyx.de/blog/goodbye-mongodb
http://blog.engineering.kiip.me/post/20988881092/a-year-with-mongodb
http://blog.schmichael.com/2011/11/05/failing-with-mongodb/
精彩评论