-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Aggregation Framework
-
None
-
ALL
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 } ) );