1
I want to add a built-in document, I’m using the $push
update, in schema I put the attribute as index: { unique : true }
, but not respecting the rule this registering item as the same name
Can someone help me?
var funcionario = new Schema({
nome : { type : String, index : { unique : true } }
});
var empresa = new Schema({
nome : { type : String },
funcionario : [ funcionario ]
});