Database Search

Hi, I have created a simple database search by learning in a tutorial video however my code is not working. In the moment that I try to preview my page and use the search bar all elements disappear. Can someone help with that code?

import wixData from ‘wix-data’ ;

export function ititle_keyPress ( event , $w ) {
filter ( $w ( ‘#ititle’ ). value );
}

function filter ( title ) {
$w ( ‘#dynamicDataset’ ). setFilter ( wixData . filter (). contains ( ‘Terapias’ , title ));
}

Your query needs to use collection field keys which start with a small letter.

You are doing this:

$w('#dynamicDataset').setFilter(wixData.filter().contains('Terapias' ,title));

But this is what you need:

$w('#dynamicDataset').setFilter(wixData.filter().contains('terapias' ,title));

Note that you need to use terapias not Terapias. (lowercase t)