covert elasticsearch table result in key-value without using loop

Job ID: 33578851

Budget: $10 – $30 USD

Hi,
looking someone who worked with npm package @elastic/elasticsearch to run sq queries. need to covert simple result from table to json key-value pair without using for-loop.
Sample example here: https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/sql_query_examples.html. Looking some out of the box option to covert result to key-value like
[{column1:value,column2:value},{column1:value,column2:value},{column1:value,column2:value} ]