title: Mongodb concat int and string
body: <p>I'm trying to project FileName and FileSize for all my files in my collection with a size of 50 mb and greater, but I cannot concat a the type FileSize as it has a type of Int</p>
  
  <p>I want the projection to be</p>
  
  <pre><code>{
  "result" : [ 
      {
          "_id" : ObjectId("5652c399a21dad0bb01b6308"),
          "FileName" : "1234567890.xml",
          "FileSize" : "11.06 MB"
      }, 
      {
          "_id" : ObjectId("5652c399a21dad0bb01b630f"),
          "FileName" : "2468101214.xml",
          "FileSize" : "320.48 MB"
      }, 
      {
          "_id" : ObjectId("5652c399a21dad0bb01b631f"),
          "FileName" : "3691215180.xml",
          "FileSize" : "12.95 MB"
      }
  }
  </code></pre>
  
  <p>But so far I can Only return the following</p>
  
  <pre><code>{
  "result" : [ 
      {
          "_id" : ObjectId("5652c399a21dad0bb01b6308"),
          "FileName" : "1234567890.xml",
          "FileSize" : 11.0610504150390630
      }, 
      {
          "_id" : ObjectId("5652c399a21dad0bb01b630f"),
          "FileName" : "2468101214.xml",
          "FileSize" : 320.4827098846435500
      }, 
      {
          "_id" : ObjectId("5652c399a21dad0bb01b631f"),
          "FileName" : "3691215180.xml",
          "FileSize" : 12.9519605636596680
      }
  }
  </code></pre>
  
  <p>My query:</p>
  
  <pre><code>    db.MyCollection.aggregate(
  
    // Pipeline
    [
      // Stage 1
      {
        $match: {
        FileSize: {$gte: 5000000}
        }
      },
      // Stage 2
      {
        $project: {
          FileName: 1,
          FileSize: {$divide: ["$FileSize", 1048576]}
        }
      },
      // Stage 3
      {
          $project:{
              FileName:1,
              FileSize:{$concat:["$FileSize", "MB"]}
          }
       }
  </code></pre>
  
  <p>How do I concat the FileSize and "MB" field?</p>