-
Type:
Bug
-
Resolution: Done
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: Aggregation Framework
-
None
-
ALL
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
Observed behavior: It is possible to create a $group aggregate field with a field name containing a dot.
Expected behavior: No dots allowed, uassert instead.
I think the dots might cause a problem when a group merger on mongos attempts to access fields set in the mongod results, but I haven't tested that specifically.
Test:
c = db.c; c.drop(); c.save( { a:2 } ); c.save( { a:1 } ); printjson( c.aggregate( { $group:{ _id:0, 'z.x':{ $push:'$a' } } } ) );
Result:
{ "result" : [ { "_id" : 0, "z.x" : [ 2, 1 ] } ], "ok" : 1 }