I have created schema like below
var TeamSchema = new Schema({
name: {
type: String,
default: '',
unique : true
},
location: {
type: String,
unique: true
}
};
mongoose.model('Team', TeamSchema);
In above for Location attribute unique:true by mistake. After that I removed unique:true and tried to add data but still it throws following error.
errmsg: 'E11000 duplicate key error index: Hackathon.teams.$location_1 dup key: { : "Bangalore" }'
How to solve this and How to handle schema If I want to add More fields ?