4
Good morning,
I have a Collection in the mongodb with a field unique:true
.
I would like to change this field to false.
If I change the code and delete all Collection works, but if I make the change in the code and do not delete the Collection he doesn’t accept.
My schema is 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}
});
Thank you very much yamadapc, it worked.
– Guilherme Ferreira
Don’t forget to accept the answer if your problem has been solved :)
– yamadapc