title: How to format the JSON object key/value pair
body: <p>I am new to nodejs, right now I am able to fetch the data from the database and display as REST API which is of key/value pair. My output looks like as shown below</p>
  
  <pre><code>[{"id":"793","actionname":"test_bsc_interface","actionid":"100"}].
  </code></pre>
  
  <p>But I need to format as</p>
  
  <pre><code>{ "header" : [id,actionname,actionid],
  
    "values" : [793 ,test_bsc_interface,100] ],}.
  </code></pre>
  
  <p>I tried with <code>JSON.stringfy</code> and checked few website but it's not working.</p>
  
  <p>Could any one please help me through which link I should go through or approach.</p>