Open Toffaa opened 3 years ago
Hello @Toffaa, sorry for the delay. Get the length of a filtered array is not supported yet, we are working on a new aggregation system that will solve this issue. We will notify you when it's available. An alternative is to preprocess the length before, insert the value in your JSON dataset and call Carbone. Let me know if this alternative is enough for you.
Environment Carbone Version: Carbone Studio (3.X.X)
Steps to reproduce
Template:
Cars number: {d.cars:len()} Toyota number: {d.cars[brand="Toyota"]:len()}
Data:
{"cars": [ {"brand": "Lumeneo","power": 2}, {"brand": "Tesla","power": 3}, {"brand": "Toyota","power": 1}, {"brand": "Toyota","power": 4} ]}
Hello,
I'm not sure if that's a bug or not, but it would be great to be able to get the length of filtered arrays. In my exemple, the first :len() works properly, while the second displays nothing.
Thank you for your work ! Kind regards, Toffaa