Hi,
Have been working with MongoMapper for a few weeks now, and
seem to have hit a known issue with geospatial queries being
limited to 100 results. After reading arounf a bit I thought 'no
problem, I'll just add my own limit at the end of the query',
but even this doesn't seem to work. Here's what I've got so far:
EARTH_RADIUS_M = 3959
query[:latlng] = {'$nearSphere' => [lat, lng], '$maxDistance' => Float(distance_in_miles.to_i) / EARTH_RADIUS_M }
Now, no matter what limit I put on the end, I seem to get
100, e.g:
applications = Application.where(query).count
=> 100
applications = Application.where(query).limit(50).count
=> 100
applications = Application.where(query).limit(10000).count
=> 100
applications = Application.where(query).limit(10).count
=> 100
Any ideas?
Cheers
--
You received this message because you are subscribed to the Google
Groups "MongoMapper" group.
For more options, visit this group at
http://groups.google.com/group/mongomapper?hl=en?hl=en