Forum Discussion
Aleksandar_A
2 years agoContributor III
Hello akarsh,
You can try with grouping all of the documents into a single array, then using reduce to combine them in one object.
Please note that if you have duplicate keys through the documents, they will overwrite.
Please refer to the attached pipeline and let me know if this helps you.
Regards,
Aleksandar.
Aleksandar_A there is a possibility that IcustomerIFANumber might not be present . is there a way to skip the mapping when its not present?
$dataList.map(x => x.customerIFANumber != null ? x.customerIFANumber : null).filter((x,ind,arr) => arr.indexOf(x) == ind).toString()
Related Content
- 3 years ago
- 2 years ago
- 4 months ago