I added a new field in the production Mongo Database and need to create a unique index on it. If I try to create one it keeps throwing 'exception: E11000 duplicate key error index:'.
I understand documents without the new field have a null
value which is causing the uniqueness violation. How should I do it?