filtering a DataSet in Wix Code

I actually found a workable solution. I removed the DataSet element which was created through the editor and included the initial connection in the code. So now it won’t do a query unless I call the function in my code.

import wixData from 'wix-data';

function query() {
  let query = wixData.query("CollectionName")
  query = query.limit(50);
  //put here all your query criteria
  query.find()
  .then( (results) => {
    $w("#repeater1").data = results.items;
    }
}