Question
How to filter data with the key value? That is, take only those list elements where value != 0
{
"value": "4742810000",
"transaction_id": 21212121
}
using listFilter(list: $#nfv; key: "value" != "0")
for some reason does not filter.
Answer
The fact is that the name of the element in rowList that needs to be filtered matches the control command in the key
parameter.
There are 3 control commands: key
, value
, and item
.
value
as a control command means "evaluate the content of each row entirely" ā that's why it doesn't work.
To indicate that we have an element named value
, item
, or key
, we need to specify that it is an element and pass its name as a separate parameter:
= : listFilter(list: $#nfv; key: "item" != "0"; item: "value")