Good morning,
I have a collection in mongodb with a unique:true
field.
I would like to change this field to false.
If I change the code and delete the entire collection it works, but if I make the change in the code and do not delete the collection it does not accept.
My schema looks like this:
var chamadosSchema = new Schema({
CODIGO_CONTRATO:{type:String, default:'', required:true},
CODIGO_IMOVEL:{type:String, default:'', unique:true, required:true},
ENDERECO:{type:String, default:'', required:true},
BAIRRO:{type:String, default:'', required:true},
PRIORIDADE:{type:String, default:'', required:true},
NOME_PROPRIETARIO:{type:String, default:'', required:true},
DDD_PROPRIETARIO:{type:String, default:''},
TEL_RESIDENCIAL_PROPRIETARIO:{type:String, default:''},
TEL_CELULAR_PROPRIETARIO:{type:String, default:''},
TEL_COMERCIAL_PROPRIETARIO:{type:String, default:''},
E_MAIL_PROPRIETARIO:{type:String, default:''},
SOLICITANTE:{type:String, default:'', required:true},
TEL_RESIDENCIAL_SOLICITANTE:{type:String, default:'', required:true},
TEL_COMERCIAL_SOLICITANTE:{type:String, default:''},
EMAIL_SOLICITANTE:{type:String, default:''},
RP_CHAMADO:{type:String, default:'', required:true},
DATA_CHAMADO:{type:Date, default:'', required:true},
SOLICITACAO:{type:String, default:'', required:true}
});