I am attempting to count items after a query and change a text value to show the count. However, the text does not change. Could someone point me to the error in my code below?
export function searchbutton_click(event) {
wixData.query(“dataset1”)
.contains(“keywords”, “test”)
.count()
.then( (num) => {
let numberOfItems = num;
$w(‘#text1’).text = numberOfItems.toString();
} )
. catch ( (error) => {
let errorMsg = error.message;
let code = error.code;
} );
}