MongoException: Index with name: code already exists with different options
问题 I have a mongodb collection term with following structure { "_id" : "00002c34-a4ca-42ee-b242-e9bab8e3a01f", "terminologyClass" : "USER", "code" : "X67", "terminology" : "some term related notes", "notes" : "some notes" } and a java class representing the term collection as Term.java @Document public class Term{ @Id protected String termId; @Indexed protected String terminologyClass; @Indexed(unique=true) protected String code; @Indexed protected String terminology; protected String notes; /