db.集合名.ensureIndex({字段a:1,字段b:1,字段c:1},{unique:true});字段不需要加引号 , 1代表升序
mongodb设置联合唯一索引
原文:https://www.cnblogs.com/angdh/p/14179090.html