Details
-
Improvement
-
Resolution: Done
-
Major - P3
-
None
-
None
Description
The documentation says $unwind of an empty array passes through the source document unchanged. There are code comments stating that the behavior is to replace the empty array with a null value when unwinding. The actual behavior appears to be that the array field is removed from the document.
c = db.c;
|
c.drop();
|
|
|
c.save( { a:[] } );
|
printjson( c.aggregate( { $unwind:'$a' } ) );
|