MongoDB interview question

Write a function that removes all duplicates from an array