title: Using Aggregate to rename a field in MongoDB
body: <p>Working on query to rename field 'expertise' to skills, expertise is an array which holds more than one so looking to slice it to 1.
  Example of table:{ &quot;_id&quot; : &quot;E08&quot;, &quot;name&quot; : &quot;Damien Collins&quot;, &quot;expertise&quot; : [ &quot;Python&quot;, &quot;Java&quot; ] }</p>
  <p>Looking to show named, expertise as &quot;skill&quot; and just to show one piece of expertise.</p>
  <p>Current query:</p>
  <pre><code>db.employees.aggregate([{expertise:{$exists:true}},{$project:{_id:1,&quot;Skill&quot;:{expertise{$slice:1}},name:1}}])
  </code></pre>
  <p>Had it working before the rename of skill part.</p>