Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-6198

$group aggregate field names can contain dots, may cause problems with sharding

    • ALL

      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
      }
      

            Assignee:
            matt.dannenberg Matt Dannenberg
            Reporter:
            aaron Aaron Staple
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: