title: $concat with lookup fields?
body: <p>I am trying to <code>$concat</code> some fields in a MongoDB aggregation. The problem is that they are coming from  <code>$lookup</code> and apparently they can't be concatenated just like that. Here is what I'm trying:</p>
  
  <pre><code>    {
          $lookup: {
              from: 'users',
              localField: 'user_id',
              foreignField: '_id',
              as: 'user'
          }
      },
      {
          $project: {
              'fullname': { $concat: ['$user.lastname', ', ', '$user.firstname' ] }
          }
      }
  </code></pre>
  
  <p>This results in the following error message:</p>
  
  <pre><code>$concat only supports strings, not array
  </code></pre>
  
  <p>Interestingly, if I use <code>$concatArrays</code>, the message will be:</p>
  
  <pre><code>$concatArrays only supports arrays, not string
  </code></pre>
  
  <p>So how do I refer to a lookup field in <code>$concat</code>?</p>