0
Controller
async index(req, res) {
const avali = await Avaliacao.find(req.body)
.populate('Time').exec((time, err) => {
console.log(`Para retorna tudo ${time}`)
})
return res.send(avali)
},
Model
const AvaliacaoShema = new Schema({
responsavel: {
type: String
},
time: [{
type: Schema.Types.ObjectId,
ref: 'Time',
}]
})
module.exports = model('Avaliacao', AvaliacaoShema)
I’m trying to give a req.body, but in the time field does not return the value of the object with the expected.