Setting up a data filter and following the real estate example: https://www.youtube.com/watch?v=QhMKnm1f6EU
It took a bit to figure out I needed some default values and "Dataset is now filtered" but undefined. I have been checking forums and trying suggestions but nothing yet to resolve the issue. Thanks for any assistance !!
Database: Properties
Collection ID: Items
here is my code:
import wixData from 'wix-data';
export function buttonSearch_click(event, $w) { $w("#itemsDataset").setFilter(wixData.filter()
.contains("propertyType", $w('#dropProperty').value) .ge("bedrooms", $w('#dropBedrooms').value) .between("price",parseFloat($w('#dropPriceLow').value), parseFloat($w('#dropPriceHigh').value)))
.then((results) => {
console.log("Dataset is now filtered");
$w("#repeater2").data = results.items;
}).catch((err) => {
console.log(err);
});
$w("#repeater2").expand();
}
So id always suggest following David suggestion and console log it.
But I like to give a little something you can investigate. this error is normally because results is unable to be set because one of the value types does not match. (Number trying to be a string etc)
My first assumption would be
.ge("bedrooms", $w('#dropBedrooms').value)
One is a number and the other is a string. resulting in failure to run the .ge and leaving result unassigned.
When you try console.log(results.items) or console.log(typeof results.items) instead, what do you see in console?