I have this schema:
var UserSchema = new Schema({
documento: []
});
and this types of documents:
var RgSchema = new Schema({
tipo: 'RG',
numero: stringType(),
orgaoEmissor: stringType(),
dataExpedicao: dateType()
});
var CpfSchema = new Schema({
tipo: 'CPF',
numero: stringType()
});
how to set different types of schema (RgSchema or CpfSchema) in the documento: []?
A kind of this:
documento: [RgSchema || CpfSchema]