Filter by price range

Hi,

I hope you can help me because I’m going crazy :frowning:

I need to show the #itemsDataset images filtered but I have a problem with the price range filter. The prices of the products are in #dataset1, where they are referenced to #itemsDataset

I have this code:

wixData.query('Stores/Products')
  .ge('price', 0)
  .le('price', 400)
  .find()
  .then(results => {
    let itemsIds = results.items.map(item => item._id);
    let filter = wixData.filter().eq('_id', itemsIds);
    return wixData.query('Items').setFilter(filter).find();
  })
  .then(items => {
    $w('#itemsDataset').setItems(items.items);
  })
  .catch(err => {
    console.log(err);
  });