Filtering by multiply dropdown

hi guys, I have a database named product.
I want to filter my products from high price to low price using multi filtering feature. How can I do that. I am using the dropdown named #dropdown3 for this feature. . forMy codes–>

function search() {

wixData.query("products") 
    .contains("location", String($w("#dropdown1").value)) 
    .and(wixData.query("products").contains("shoes", String($w("#dropdown2").value))) 
	
    //code here, I want to filter by lowest price from highest price. btw for field name in db = "price" 
	
    .find() 
    .then(results =>{ 
        $w("#repeater9").data = results.items 
    }) 

}

Your code should treat the results, like this:

function search() {
    wixData
        .query("products")
        .contains("location", String($w("#dropdown1").value))
        .and(
            wixData
                .query("products")
                .contains("shoes", String($w("#dropdown2").value))
        )
        .find()
        .then(results => {
            const resultItems = results.items
            const filteredResults = resultItems.filter(item => item.price > 100)
            $w("#repeater9").data = filteredResults
        })
}


Ty Bruno. I tested it but it didn’t work. it shows no results. Are you sure use #dropdown3?

I’m sorry, I assumed your code was partially working, but I can see some mistakes. I was only dealing with the results.

Your code should be something like this:

function search() {
    let searchLocation = wixData
        .query("products")
        .contains("location", String($w("#dropdown1").value))

    let searchShoes = wixData
        .query("products")
        .contains("shoes", String($w("#dropdown2").value))

    searchLocation
        .and(searchShoes)
        .find()
        .then(results => {
            const resultItems = results.items
            const sortedResults = resultItems.sort($w("#dropdown3").value)
            $w("#repeater9").data = sortedResults
        })
}

$w("#dropdown3").onChange(({ target }) => {
    const data = $w("#repeater9").data
    const sortedData = sortData(data, target.value)
    $w("#repeater9").data = sortedData
})

function sortData(array, direction) {
    switch (direction) {
        case "asc":
            return array.sort((a, b) => (a > b ? 1 : -1))
        case "des":
            return array.sort((a, b) => (a < b ? 1 : -1))
    }
}

Just make sure that your #dropdown3 have the two values being assigned to the labels, ex:

Lowest to Highest = “asc”
Highest to Lowest = “des”

Sorry i was bussy Bruno. I could not answer. Thank you we succeed. Can I ask one more question? Is it possible change slideshow images duration in velo? Duration between slides minimum 3 sec. i need less