Query filter product by Collection(now called category)

It would be more informative if you would present an excerpt of your database, or a example of it.

  1. What is the ID of your DATABASE ?
  2. Are you using a DATASET ?
  3. Or do you want to use → Wix-Data?
  4. What is the ID of the DB-Field, you want to filter in?
  5. 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);});
});