title: MongoDb create unique index on a field not in all documents
body: <p>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:'. </p>
  
  <p>I understand documents without the new field have a <code>null</code> value which is causing the uniqueness violation. How should I do it?</p>