In this video, we are going to convert the IDs of the pose of which the user has created into red posts.
And we are going to use a method called populates on the user.
So let's get back to the controllers and inside users, which is this.
And let's look at the controller for profile, which is this one.
So let's expand it.
And upon making a query to the DB, we can add a method called populate.
And this populate we pass in the field that we want to populate and the fields on the user is called
post.
If we check the user model, you can see that we have a field called post.
That is what I pass in into the populate.
So now with this one, if I make a request to the profile and let's have a look, you can see inside
of the IDs now we have the real post and this is awesome.
So in front end we can now display the real post of the user.
The next video.
Let's see how we can fetch a single post.