How to distinct JSON array by value, using javascript. Below is my JSON array. I want to calculate the size of distinct elements.
[
{
"_id": "5aaa4f8cd0ccf521304dc6bd",
"email": "[email protected]"
},
{
"_id": "5aaa50a0ac40d32404c8bab7",
"email": "[email protected]",
},
{
"_id": "5aa8ace3323eeb001414a2c5",
"email": "[email protected]"
},
{
"_id": "5aa86645323eeb001414a2af",
"email": "[email protected]"
}
]
The expected results should be 3.