Same backend-kod for fields with different names?

This frontend-code worked for inserting and displaying likes for a photo:

$w(“#emptyHeart1”).onClick((event) => {
wixData.get(“Members”, memberId)
.then((memberInfo) => {
$w(‘#emptyHeart1’).collapse();
$w(‘#fullHeart1’).expand();
$w(‘#likes1’).text = (parseInt($w(‘#likes1’).text) + 1).toString();
memberInfo.likes1 = true;
wixData.update(‘Members’, memberInfo).catch();
})
});

This is the backend-code for that function in data.js but I am confused because I have fields with different names for the likes (likes1, likes2, likes 3 etc.) and wonder if the single name > “files” < in this code can apply for different names? Or do I have to copy the original code and make a new one in data.js for every fieldname?

import wixData from ‘wix-data’;

export function Members_beforeUpdate(item, context) {
if (item.likes) {
return wixData.get(context.collectionName, item._id, { “suppressHooks”: true })
.then(itemToUpdate => {
itemToUpdate.likes ? itemToUpdate.likes += 1 : itemToUpdate.likes = 1;
return itemToUpdate;
})
}
return item;
}

Ps! By the way… I hate that this > item.likes1 = true; < makes the number to become “true” on the page and in the database instead of number digits. Can I write something else than true to avoid that?