Unexspected Token

I found a code for a filter on youtube but if I try to build the filter I always get an error because of an unexspected token. Can someone pleasy help me? This is my code:

the line with .catch is: }). catch ((err) => {

Note that your use of results in line 18 is incorrect - results is not returned by setFilter().

You can see some code examples of setFilter() in the API . You apparently have a mismatch of parentheses or brackets which is causing the error. I believe that adding a line with a right parenthesis ) in line 17 will fix the error .

Here’s one example from the docs (with the missing line commented):

$w("#myDataset").setFilter( wixData.filter()
  .startsWith("lastName", "D")
  .ge("age", "21")
) // this line is missing in your code
.then( () => {
  console.log("Dataset is now filtered");
} )
.catch( (err) => {
  console.log(err);
} );

Hey, thank you very much. The parenthesis has fixed the problem :slight_smile: