How to do Number of click? Please help

I’m try to count how many click on the data
My database called “NewCollectionName”
the counter field called “NOC” // number of click

import wixData from ‘wix-data’;
export function text2_click(event, $w) {
wixData.query(“NewCollectionName”).eq(‘Title’,$w(‘#text2’).text).find().then((result) => {
let answersitem = result.items[0];
let id = answersitem._id;
answersitem.Noc++;
wixData.update(“NewCollectionName”,answersitem).then(()=>{
$w(‘#dataset2’).refresh();
});
})
}

Seems like your code should work.
Please make sure you’re using the correct case for the collection and field name as both are case sensitive. For example, are you sure the field name is “Noc” and not “noc”? You can verify it by checking your collection and looking at the field key (can be seen by clicking Manage Properties).

yup, you’re right! This is about case sensitive and it works after correct it. Thanks a lot!