output redirection to existing file question

So I have a existing file that I used the uniq command on and I need to save the output to the same file without changing the file name.

I have tried $ uniq filename > filename

then when I cat the file it then becomes blank like there is nothing inside.

any help would be much appreciated thanks.