Given this document:
const genDoc = () => {
Senders: genSenders(),
Anomalous: genAnomaly()
};
I want to create an array mapped with Anomalous fields true and counting the number of Anomalous documents for each sender.
So the output array would contain Senders with number of Anomalous 'true' states.
const itemsFiltered = items.filter((i) => i.Anomalous === true);
const senders = itemsFiltered.map(
(i, idx) => i.Anomalous && { id: idx + 1, senderName: i.senders }
);
Haven't been able to extract counts yet. Any ideas?
Via Active questions tagged javascript - Stack Overflow https://ift.tt/OQG5vNC
Comments
Post a Comment