Details
-
Bug
-
Resolution: Done
-
Major - P3
-
None
-
3.1.8
-
None
-
Fully Compatible
-
ALL
Description
This aggregation, when aaaa and bbbb are both non-existent fields generates inconsistent result:
db.foo.aggregate({$project:{aaaa:"$aaaa", bbbb: [ "$bbbb" ]}})
|
{ "_id" : ObjectId("55cce7defd4e487ca8f05319"), "bbbb" : [ null ] }
|
{ "_id" : ObjectId("55cce7defd4e487ca8f0531a"), "bbbb" : [ null ] }
|
{ "_id" : ObjectId("55cce7defd4e487ca8f0531b"), "bbbb" : [ null ] }
|
{ "_id" : ObjectId("55cce7defd4e487ca8f0531c"), "bbbb" : [ null ] }
|
I would have expected aaaa to be missing and bbbb to be an empty array, not an array with explicit null. That seems more consistent with aaaa showing up with null value.