更新时间:2023-02-14 08:21:31
在mongo shell中的简单解决方案:`
an easy solution in mongo shell: `
use your_db
db.your_collection.createIndex({'1': 1, '2': 1, '3': 1, etc until you reach maximum expected letter count}, {unique: true, dropDups: true, sparse:true, name: 'dropdups'})
db.your_collection.dropIndex('dropdups')
注释: