If I had a schema like this:
var person = new Schema({
firstName: String,
lastName: String,
});
const personSchema = new Schema({ firstName: String, lastName: String });
const person = mongoose.model('recipients', personSchema);
person.createIndexes();
You might need to get rid of all duplicates in the collection or do it the faster and easy way :
Edit your Code, Drop the Collection and then restart Mongo.