-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.0.2
-
Component/s: None
-
None
-
Environment:FreeBSD 8.2, 64-bit
-
ALL
Here is dump of mongo shell.
- some documents have "jclient.targets_list" == []
> db.mondata.find({"jclient.targets_list": {$exists: true}}).count()
578244 - some documents have no "jclient" at all
> db.mondata.find({"jclient.targets_list": {$exists: false}}).count()
3943 - it's indexed field
> db.mondata.getIndexKeys()
[
[skipped] { "jclient.targets_list" : 1 }]
- and.... here is "distinct"
> db.mondata.distinct("jclient.targets_list")
[ null, null ]
It really looks like bug.
Here are some more strange samples:
> db.mondata.distinct("jclient.targets_list", {"jclient.targets_list": {$exists: true}})
[ ]
> db.mondata.distinct("jclient.targets_list", {"jclient.targets_list": {$exists: false}})
[ null ]
- so [] + [null] should be [null], should not it?
> db.mondata.distinct("jclient.targets_list", {$or: [{"jclient.targets_list": {$exists: false}}, {"jclient.targets_list": {$exists: true}}]})
[ ]
- depends on
-
SERVER-6102 Shell displays both 'undefined' and 'null' type as 'null'
- Closed