Details
-
Bug
-
Resolution: Done
-
Major - P3
-
None
-
None
-
ALL
Description
DocumentSourceUnwind does not advance properly if getCurrent() is not called before advance(). And there may be a problem with eof() if pUnwindValue is set but pUnwinder is exhausted.
Observed behavior: An incorrect result set may be generated for pipelines involving $unwind, particularly if used in conjunction with $skip.
Expected behavior: Correct result set.
Test:
c = db.c;
|
c.drop();
|
|
|
c.save( { a:[ 1, 2 ] } );
|
// One result expected, but none returned.
|
printjson( c.aggregate( { $unwind:'$a' }, { $skip:1 } ) );
|