Tip on bulk insert query_

Hey @agaitan026!

If you're looking to change the names of your columns I imagine _.mapKeys might be a pretty good way to go. Does something like this work?

const tableData = {{ table2.data }};
const keyMappings = {
   key1_in_retool: "key1_in_db",
   key2_in_retool: "key2_in_db"
};
const keyMapper = (row) => _.mapKeys(row, (_, key) => keyMappings[key] ?? key);

return tableData.map(keyMapper);
1 Like