Hi everyone,
I have a collection of todo list names and a second collection of item of the list.
I perform a query who return me the list of item with elements I need to compute.
{ data: [ { exp: 57, resRef: Ref(Collection("Items"), "275703064172691981") }, { exp: 57, resRef: Ref(Collection("Items"), "275703064172691981") }, { exp: 23, resRef: Ref(Collection("Items"), "275703064172691981") }, { exp: 22, resRef: Ref(Collection("Items"), "275703064172691981") }, { exp: 12, resRef: Ref(Collection("Items"), "275703036630794764") }, { exp: 10, resRef: Ref(Collection("Items"), "275703064172691981") }, { exp: 10, resRef: Ref(Collection("Items"), "275703064172691981") }, { exp: 10, resRef: Ref(Collection("Items"), "275703064172691981") }, { exp: 9, resRef: Ref(Collection("Items"), "275703036630794764") }, { exp: 5, resRef: Ref(Collection("Items"), "275703064172691981") }, { exp: 3, resRef: Ref(Collection("Items"), "275703036630794764") } ] }
I need as a result to reduce the list and compute the exp to get a result like:
{ data: [ { exp: 194, resRef: Ref(Collection("Items"), "275703036630794764") }, { exp: 24, resRef: Ref(Collection("Items"), "275703064172691981") }, ] }
I spend 2 days with Distinct, filter, and reduce, without success. If someone has an idea could be awesome. Thank you :