Need help with a search database piece of code

import wixData from “wix-data”;

export function iTitle_keypress(event, $w) {
console.log($w(‘#iTitle’).value);
filter($w(‘#iTitle’).value);
}
function filter(title) {
$w(‘#dataset1’).setFilter(wixData.filter().contains(‘Tipo,title’));
}

I got this code from a wix video in youtube: Wix Code | How to Create a Search for Your Database - YouTube

It happens that i have a similar scenario than the one shown in he video but the code won’t work for me, i am only trying to use the portion of code related to a search with an input element. Since i am not a code expert by any means, I am confused with the part of contains(‘Tipo,title’) my guess is that my problem is here somehow but i don´t know what it is for each of the two parameters in the “contains” command.

From a glance you have a bug in your filter function

function filter(title) {     
    $w('#dataset1').setFilter(wixData.filter()
    .contains('Tipo,title') //this
    ); 
} 

it should be

.contains('Tipo', title)

good catch, let me test , hopefully that fix it all

bad news. still not working.

I have been trying with different field in the database but result is the same. This is the corrected code:

import wixData from “wix-data”;

export function iTitle_keypress(event,$w) {
console.log($w(‘#iTitle’).value);
filter($w(‘#iTitle’).value);
}
function filter(operacion) {
$w(‘#dataset1’).setFilter(wixData.filter().contains(‘operacion’,operacion));
}