title: Extract value of array and add in the same select mongoDB
body: <p>I am new to the mongoDB aggregation and I have this situation. I have this Json and I need to convert by &quot;select&quot; this object:</p>
  <pre><code>{
      &quot;type&quot;: &quot;PF&quot;,
      &quot;code&quot;: 12345
      &quot;Name&quot;: Darth Vader,
      &quot;currency&quot;: &quot;BRL&quot;,
      &quot;status&quot;: &quot;SINGLE&quot;,
      &quot;adress&quot;: [
          {
              &quot;localization&quot;: &quot;DEATH STAR&quot;,
              &quot;createDate&quot;: 1627990848665
          },
          {
              &quot;localization&quot;: &quot;TATOOINE&quot;,
              &quot;createDate&quot;: 1627990555665
          },
      ]
  }
  </code></pre>
  <p>this way:</p>
  <pre><code>{
      &quot;type&quot;: &quot;PF&quot;,
      &quot;code&quot;: 12345
      &quot;Name&quot;: Darth Vader,
      &quot;currency&quot;: &quot;BRL&quot;,
      &quot;status&quot;: &quot;SINGLE&quot;,
      &quot;localization&quot;: &quot;DEATH STAR&quot;,
      &quot;createDate&quot;: 1627990848665
  },
  {
      &quot;type&quot;: &quot;PF&quot;,
      &quot;code&quot;: 12345
      &quot;Name&quot;: Darth Vader,
      &quot;currency&quot;: &quot;BRL&quot;,
      &quot;status&quot;: &quot;SINGLE&quot;,
      &quot;localization&quot;: &quot;TATOOINE&quot;,
      &quot;createDate&quot;: 1627990555665
  }
  </code></pre>
  <p>So, after my query is complete, I will have 02 objects instead of 01. How can I do this?
  I would like to do this via select because after converting I will sort by createDate and limit the number of records to return to the API. I'm using Criteria em my project.</p>