wixData.filter() for data field containing array of objects

Hi!

My collection contains a field ‘price’, which contains following array:

[
  {
    "Currency": "EUR",
    "Amount": {
      "Base": 59.95,
      "Discount": "0%"
    }
  }
]

How can I apply the le() function using wixData.filter().le()? The check for the price should happen on the level of price[0].Amount.Base and not on the level of price, so it’d have to be able to do something like wixData.filter().le(“price[0].Amount.Base”,60) As Wix allows me to create objects in my collection, I suppose this should somehow be possible. Unfortunately this doesn’t seem to work? What’s the right syntax here?

Try:

wixData.filter().le("price.Amount.Base", 60) 

Thanks @jonatandor35 , this indeed seems to work. However, what if I’d have multiple items in my array? Would I have to use an iterator then? I find it rather strange that I can disregard the iterator for the key.

@vervoortyves I think it’s supposed to return all the items with Amount.Base <= 60
And you’re right it’s not trivial and I didn’t know that either, but I happened to ask one of the experts at Wix a similar question just a few days ago.