-
Type: Task
-
Resolution: Won't Fix
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: manual
-
Labels:None
In some situations null and missing are considered equivalent for the group key, in other places they are considered as distinct. Since it is likely impossible that we can change this behavior since it is user facing, we should document it for clarity.
ex: > db.col.find() { "_id" : ObjectId("611551d7a383be5dd4240f53"), "a" : 1 } {"_id" : ObjectId("611551dba383be5dd4240f54") } "_id" : ObjectId("611551e1a383be5dd4240f55"), "a" : null } null == missing > db.col.aggregate({$group: {_id: '$a'}}) {"_id" : null } {"_id" : 1 } null == missing > db.col.aggregate({$group: {_id: {'a': '$a'}}}) {"_id" : {"a": null }} {"_id" : {"a": 1}} null != missing > db.col.aggregate({$group: {_id: {'a': '$a', 'b': '$a'}}}) {"_id" : { "a" : null, "b" : null } } {"_id" : { "a" : 1, "b" : 1 } } {"_id" : { } }