Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ImamCandra opened this issue Jan 7, 2019 · 2 comments
Open

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

ImamCandra opened this issue Jan 7, 2019 · 2 comments

Comments

@ImamCandra
Copy link

ImamCandra commented Jan 7, 2019

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
Copy link

Have you found a solution for this?

@sugoiporu
Copy link

found the solution!

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

in you case, .populate('tes')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants