Wix Velo debugging

Hello,
Does anyone find the fault in my code? I got the same exact code on another website and it works perfectly fine - but now on the new one it doesn’t work at all…even thought the database as well as the code is exact the same.

import wixData from"wix-data";

let debounceTimer;
exportfunctioniTitle_keyPress(event, $w) {
	if (debounceTimer) {
	clearTimeout(debounceTimer);
	debounceTimer = undefined;
	}

	debounceTimer = setTimeout(() => { 
		filter($w('#iTitle').value);
	}, 200);
}

let lastFilterTitle;
functionfilter(title) {
	if(lastFilterTitle !== title) {
		$w('#dataset1').setFilter(wixData.filter().contains('Title', title));
	}
}

Hi, you can try something like this

import wixData from"wix-data";

let timerID = -1;
$w.onReady(function () {
    $w('#iTitle').onKeyPress((event)=>{
        if(timerID>0){
            //reset the timer if 2 keys are pressed in < 200ms
            clearTimeout(timerID)
        }
        timerID = setTimeout(() => {
            //executed 200 ms after the last input key
            filter(event.target.value); 
        }, 200);
    })
});
let lastFilterTitle;
function filter(title) {
    if(lastFilterTitle !== title) {
        lastFilterTitle = title;
        $w('#dataset1').setFilter(wixData.filter().contains('title', title));
    }
}

Probably in the filter.contains you have to use the column key ‘title’ instead of ‘Title’