|
Is this really not a bug? size() behaves the same despite this from the docs "size() is like count() but takes into consideration any limit() or skip() specified for the query."
For example:
> db.geos.find({ l: { $nearSphere: [0, 51.4772220], $maxDistance: 5 } }).limit(1e6).length()
|
35084
|
> db.geos.find({ l: { $nearSphere: [0, 51.4772220], $maxDistance: 5 } }).size()
|
100
|
> db.geos.find({ l: { $nearSphere: [0, 51.4772220], $maxDistance: 5 } }).limit(101).size()
|
100
|
> db.geos.find({ l: { $nearSphere: [0, 51.4772220], $maxDistance: 5 } }).limit(99).size()
|
99
|
If nothing else it seems a bit inconsistent to me that the limits would be respected only up to a point.
|