title: How to display only needed value pair from an object?
body: <p>This is my object:</p>
  <pre><code>{
      &quot;user&quot;: {
          &quot;id&quot;: 11,
          &quot;name&quot;: null,
          &quot;email&quot;: null,
          &quot;phone&quot;: &quot;000000000&quot;,
          &quot;age&quot;: null,
          &quot;role&quot;: &quot;user&quot;,
          &quot;otp&quot;: &quot;656440&quot;,
          &quot;otpCreatedAt&quot;: null,
          &quot;createdAt&quot;: &quot;2020-10-24T07:38:54.000Z&quot;,
          &quot;updatedAt&quot;: &quot;2020-10-24T07:38:54.000Z&quot;
      }
  }
  </code></pre>
  <p>Am getting this from querying on mysql db, now i dont want to send all the values to response ! Instead i need selected values to be sent under a single key !</p>
  <p>Expected output</p>
  <pre><code>{
      &quot;user&quot; :{
          &quot;name&quot;: null,
          &quot;email&quot;: null,
          &quot;phone&quot;: &quot;000000000&quot;,
          &quot;age&quot;: null,
        }
  }
  </code></pre>
  <p>I can split this and send like <code>name: user.name</code> etc but i need all the needed under single key !</p>
  <p>How to achieve this ?</p>
  <p>As of now am just splitting it like this !</p>
  <pre><code>phone: user.phone, name: user.name, age: user.age, email: user.email
  </code></pre>