1
00:00:01,150 --> 00:00:10,090
In this video, we are going to convert the IDs of the pose of which the user has created into red posts.

2
00:00:10,090 --> 00:00:14,830
And we are going to use a method called populates on the user.

3
00:00:14,860 --> 00:00:19,870
So let's get back to the controllers and inside users, which is this.

4
00:00:19,870 --> 00:00:24,910
And let's look at the controller for profile, which is this one.

5
00:00:24,910 --> 00:00:26,590
So let's expand it.

6
00:00:26,590 --> 00:00:33,280
And upon making a query to the DB, we can add a method called populate.

7
00:00:33,280 --> 00:00:39,910
And this populate we pass in the field that we want to populate and the fields on the user is called

8
00:00:39,920 --> 00:00:40,720
post.

9
00:00:40,900 --> 00:00:46,960
If we check the user model, you can see that we have a field called post.

10
00:00:46,960 --> 00:00:50,140
That is what I pass in into the populate.

11
00:00:50,140 --> 00:00:57,340
So now with this one, if I make a request to the profile and let's have a look, you can see inside

12
00:00:57,340 --> 00:01:03,250
of the IDs now we have the real post and this is awesome.

13
00:01:03,250 --> 00:01:09,100
So in front end we can now display the real post of the user.

14
00:01:09,400 --> 00:01:10,420
The next video.

15
00:01:10,420 --> 00:01:13,660
Let's see how we can fetch a single post.

