mongodb设置联合唯一索引

db.集合名.ensureIndex({字段a:1,字段b:1,字段c:1},{unique:true});

字段不需要加引号 , 1代表升序
原文地址:https://www.cnblogs.com/angdh/p/14179090.html