У меня есть эта модель
var clienteSchema = new mongoose.Schema({
nome: String,
profissao: String,
estado_civil: String,
data_nascimento: String,
cpf: String,
cidade: String,
endereco: String,
data_cadastro: {
type: Date,
default: Date.now
},
telefone: String,
estadias: [{
type: mongoose.Schema.Types.ObjectId,
ref: "Estadia"
}]
});
Я пытаюсь это заполнить, но безрезультатно.
Cliente.findById({ _id: req.params.id }).populate("estadias.Estadia").exec((err,cliente)=>{
Как я могу это сделать?