How can i use ref to another models besides from User?
ImamCandra opened this issue · 2 comments
ImamCandra commented
i want to use ref to ex: Job models, but its give some error say: job: path "job" is required.
here's my code:
tes: { type: Schema.ObjectId, ref: 'Job', required: true },
sugoiporu commented
Have you found a solution for this?
sugoiporu commented
found the solution!
go to your controller and add .populate('')
in you case, .populate('tes')