It would be more informative if you would present an excerpt of your database, or a example of it.
- What is the ID of your DATABASE ?
- Are you using a DATASET ?
- Or do you want to use → Wix-Data?
- What is the ID of the DB-Field, you want to filter in?
- If you want just a basic filter…
import wixData from 'wix-data'
let DATABASE = "your DATABASE-ID here";
$w.onready(()=>{
wixData.query(DATABASE)
.find()
.then((res)=>{
let items = res.items;
if(items.length>0) {return items}
else {return {}}
}).catch((err)=>{console.log(err);});
});