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

字段不需要加引号 , 1代表升序

 

相关文章:

  • 2021-08-29
  • 2021-09-24
  • 2022-03-05
  • 2022-12-23
  • 2021-06-19
  • 2022-12-23
  • 2022-01-18
猜你喜欢
  • 2021-11-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-08
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案