[SERVER-6131] decide on behavior to $unwind an empty array Created: 19/Jun/12 Updated: 15/Aug/12 Resolved: 13/Jul/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | None |
| Fix Version/s: | 2.2.0-rc0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Aaron Staple | Assignee: | Aaron Staple |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: |
| 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.
|
| Comments |
| Comment by auto [ 14/Jul/12 ] |
|
Author: {u'date': u'2012-07-13T16:54:37-07:00', u'email': u'aaron@10gen.com', u'name': u'astaple'}Message: |
| Comment by auto [ 13/Jul/12 ] |
|
Author: {u'date': u'2012-07-13T14:57:59-07:00', u'email': u'aaron@10gen.com', u'name': u'Aaron'}Message: |
| Comment by Eliot Horowitz (Inactive) [ 27/Jun/12 ] |
|
array with data - normal |
| Comment by Aaron Staple [ 26/Jun/12 ] |
|
@eliot - Does your comment above mean if the field is present but not an array (or if it is not present and has a non object parent) then the field should not be present in the result? Currently we just uassert in these cases. |
| Comment by auto [ 26/Jun/12 ] |
|
Author: {u'date': u'2012-06-26T12:29:04-07:00', u'email': u'aaron@10gen.com', u'name': u'astaple'}Message: |
| Comment by Eliot Horowitz (Inactive) [ 23/Jun/12 ] |
|
I actually both of those are wrong. |