diegohaz/rest

How can i use ref to another models besides from User?

ImamCandra opened this issue · 2 comments

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 },

Have you found a solution for this?

found the solution!

go to your controller and add .populate('')

in you case, .populate('tes')