I have a json like this:
const mycontacts = [
{
"fleet_name":"RancorService",
"owner":"swapneil",
"host_count":10,
"environment":"RancorService/JP",
"vip_name":"rancor-02.pdx.amazon.com",
"region":"pdx",
"lb_set":"pdx-internal-111-set",
"alternatename":"RANCOR-02-PDX-80",
"protocol":"HTTP",
"viptag":"retail_general",
"port":80,
"lb_status":"NOT_DEDICATED_VIP",
"current_req_per_sec":0.9495412127,
"current_req_res_per_gb_per_sec_payload":0.0309901519,
"req_per_sec_threshold":80,
"req_res_per_gb_sec_threshold":4,
"partition_proposed":"NO"
},
{
"fleet_name":"RancorService",
"owner":"swapneil",
"host_count":11,
"environment":"RancorService/JP",
"vip_name":"rancor-01.pdx.amazon.com",
"region":"pdx",
"lb_set":"pdx-internal-57-set",
"alternatename":"RANCOR-01-PDX-80",
"protocol":"HTTP",
"viptag":"retail_general",
"port":80,
"lb_status":"NOT_DEDICATED_VIP",
"current_req_per_sec":0.927976804,
"current_req_res_per_gb_per_sec_payload":0.030198045,
"req_per_sec_threshold":80,
"req_res_per_gb_sec_threshold":4,
"partition_proposed":"NO"
}
]
I want to rename all the keys as the following but the values of the keys should not change.
const changedkeys = { 'Fleet name', 'Owner', 'Host Count', 'Environment', 'Vip Name', 'Region', 'LBset', 'Alternate Name', 'Protocol', 'Vip tag', 'Port', 'LB status', 'Current Requirement(/sec)', 'Current Request Response Payload(/gb/sec)', 'Request Threshold(/sec)', 'Request Response Threshold(/gb/sec)', 'Partition Proposed' }
Only the key name is to be replaced with the new keys but the values of the keys should not change. How to achieve that??