How to use multiple .between() filters?

If i only use it once, it works fine, but if i tried to add another between filter it broke it. Is there a way to add multiple between filters?

//The working one
.contains("make", obj.make)
.contains("model", obj.model)
.contains("fuel", obj.fuel)
.contains("category", obj.type)
.between("price", 1000, 5000) //
.find()

//The one that i want to work
.contains("make", obj.make)
.contains("model", obj.model)
.contains("fuel", obj.fuel)
.contains("category", obj.type)
.between("price", 1000, 5000)
.between("weight", 100, 500)
.find()

I’d guess it’s not that the 2 .between don’t work, but that you have some issue with the ‘weight’ field. Does a single between with the ‘weight’ work for you?

You can try creating two filters and use .and() to combine them.

let filterPrice = wixData.filter()
    .contains("make",obj.make)
    .contains("model",obj.model)
    .contains("fuel",obj.fuel)
    .contains("category",obj.type)
    .between("price",1000,5000)    
let filterWeight = wixData.filter().between("weight",100,500)
let finalFilter = filterPrice.and(filterWeight)
$w("#myDataset").setFilter(finalFilter)

Thank you! This one is working perfectly!