From the api doc for options, added emphasis:
Flag that indicates whether this index can accept insertion or update of documents when the index key value matches an existing index key value. Set
"unique" : trueto set this index as unique. You can’t set a hashed index to be unique. This option applies to all index types. This option is unsupported for rolling indexes.