-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 2.6.0-rc1, 2.6.0-rc2
-
Component/s: Aggregation Framework
-
None
-
ALL
-
ISSUE SUMMARY
The geoNear command does not check if the BSON size limit is reached when assembling the result array.
USER IMPACT
Results from geoNear that are larger than the BSON size (16MB) cause an exception and abort the command.
WORKAROUNDS
Query for a smaller result set, for example with a smaller maxDistance value.
RESOLUTION
The geoNear command now detects when it reaches the BSON size and will truncate the result set. A warning is logged that the command tried to return a larger result.
AFFECTED VERSIONS
Version 2.6.0 is affected by this bug.
PATCHES
The patch is included in the 2.6.1 production release.
Original description
The new aggregation framework on 2.6.0 returns a cursor, so its output should be unlimited.
However if one performs an aggregation query with $geonear it looks like the output is still limited to 16MB.
> db.testData.aggregate([{$geoNear: {near :
{ type : "Point" , coordinates: [50,50] } , distanceField:"dist",spherical : true, maxDistance : (10000000), num:200000 }}])
assert: command failed: {
"errmsg" : "exception: nextSafe():
",
"code" : 13106,
"ok" : 0
} : aggregate failed
Error: command failed: {
"errmsg" : "exception: nextSafe():
",
"code" : 13106,
"ok" : 0
} : aggregate failed
at Error (<anonymous>)
at doassert (src/mongo/shell/assert.js:11:14)
at Function.assert.commandWorked (src/mongo/shell/assert.js:244:5)
at DBCollection.aggregate (src/mongo/shell/collection.js:1149:12)
at (shell):1:13
2014-04-04T11:17:26.395+0200 Error: command failed: {
"errmsg" : "exception: nextSafe():
",
"code" : 13106,
"ok" : 0
} : aggregate failed at src/mongo/shell/assert.js:13