In my mongo collection, I have an array where all element have to be unique. But by mistake, I have added duplicate elements. How can I make array elements distinct? Is there any query/command?
document in collection:
{
Tags: ["a", "a", "a"]
}
But I want:
{
Tags: ["a"]
}