help needed - Searching a dataset by name

This is the first time i’ve ever used Corvid and am very much a beginner!
I want users to be able to search their name in an input box (#input1) and a table (#table1) to display their number.

I’m having an issue and keep getting this error - “Parsing Error: unexpected token WixData”

If someone could check the code and advise if i’m making a simple mistake or advise if need to rename anything?

Code detailed below and also screenshots attached…

Thanks in advance!

import wixData from "TablePlan"
export function input1_click
// Runs a query on the "TablePlan" collection
wixData.query("TablePlan") 
 // Query the collection for any items whose "Surname" field contains  
 // the value the user entered in the input element
  .contains("Surname", $w("#input1").value)
  .find()  // Run the query
  .then(res => {   
 // Set the table data to be the results of the query     
    $w("#table1").rows = res.items; 
   });

I’m aware that this is two years late but since it’s still high in the search results, change your first line to be:

import wixData from 'wix-data';