title: Change document structure in mongodb with the mongo shell
body: <p>I have a document structure in mongodb and i want to change it for all my documents without using aggregate function like this <a href="https://stackoverflow.com/questions/27580281/reshape-all-the-documents-in-the-collection">response</a> but by creating a specific function, and have a result from that : </p>
  
  <pre><code>{
  "_id" : ObjectId("String"),
  "content" : {
      "href" : "String",
      "text" : "String",
      "code" : "String "
  }
  }
  </code></pre>
  
  <p>to that :</p>
  
  <pre><code>{
  "_id" : ObjectId("String"),
  "href" : "String",
  "text" : "String",
  "code" : "String "
  }
  </code></pre>
  
  <p>Any suggestions please. Thank you.</p>