title: Analog for group concat in sql
body: <p>In an aggregation process I've got this data:</p>
  
  <pre class="lang-js prettyprint-override"><code>{
      "_id" : "billing/DefaultController/actionIndex",
      "min_time" : 0.033,
      "max_time" : 5.25,
      "exec_time" : 555.490999999997,
      "qt" : 9059,
      "count" : 2,
      "date" : [ 
          ISODate("2014-02-10T00:00:00.000Z"), 
          ISODate("2014-02-11T00:00:00.000Z")
      ]
  },
  </code></pre>
  
  <p>How to change my query:</p>
  
  <pre class="lang-js prettyprint-override"><code>db.page_speed_reduced.aggregate([
      {$group: {
          _id: "$value.route",
          min_time: {$min: "$value.min_time"},
          max_time: {$max: "$value.max_time"},
          exec_time: {$sum: "$value.exec_time"},
          qt: {$sum: "$value.qt"},
          count: {$sum: NumberInt(1)},
          date: {$push: "$_id.date"},
      }}
  ]);
  </code></pre>
  
  <p>for getting "$date" as concatenated string:</p>
  
  <pre class="lang-js prettyprint-override"><code>2014-02-10, 2014-02-11
  </code></pre>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>I tried this variant, but mongodb generated the error:</p>
  
  <pre class="lang-js prettyprint-override"><code>db.page_speed_reduced.aggregate([
      {$group: {
          _id: "$value.route",
          min_time: {$min: "$value.min_time"},
          max_time: {$max: "$value.max_time"},
          exec_time: {$sum: "$value.exec_time"},
          qt: {$sum: "$value.qt"},
          count: {$sum: NumberInt(1)},
          date: {$push: "test sting"},
      }},
      {$project: {
          'date': {$concat: ['$date']}
          //'date': {$concat: '$date'} //some error
      }}
  ]);
  
  uncaught exception: aggregate failed: {
   "errmsg" : "exception: $concat only supports strings, not Array",
   "code" : 16702,
   "ok" : 0
  }
  'date': {$concat: '$date'}
  </code></pre>