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": "abc@gmail.com"
            },
            {
                "_id": "5aaa50a0ac40d32404c8bab7",
                "email": "pqr@gmail.com",
            },
            {
                "_id": "5aa8ace3323eeb001414a2c5",
                "email": "xyz@gmail.com"
            },
            {
                "_id": "5aa86645323eeb001414a2af",
                "email": "abc@gmail.com"
            }
    ]
The expected results should be 3.
 
     
    