1
00:00:00,240 --> 00:00:05,190
All right, and once we're done with fundamentals, let's finally learn some cool new things as well.

2
00:00:05,700 --> 00:00:07,920
And first in line is not populated.

3
00:00:08,460 --> 00:00:15,870
And what's really cool about popularity method is that it allows us to reference documents in other

4
00:00:15,870 --> 00:00:16,410
collections.

5
00:00:16,800 --> 00:00:17,790
Why is that useful?

6
00:00:18,180 --> 00:00:26,040
Well, with the help of populate, we could get specific info about the product when requesting all

7
00:00:26,040 --> 00:00:26,550
reviews.

8
00:00:27,420 --> 00:00:35,670
So the moment when we get back all the reviews we can actually see user which references the user I.D.

9
00:00:36,030 --> 00:00:38,760
and the same goes for product.

10
00:00:39,510 --> 00:00:41,070
Now all is nice.

11
00:00:41,580 --> 00:00:46,140
But what if I want more info on the actual product?

12
00:00:46,950 --> 00:00:53,610
For example, I want name company and price and the way we set that up.

13
00:00:54,030 --> 00:00:57,450
First, we want to go back to all reviews.

14
00:00:57,870 --> 00:01:05,459
And then right after fine, just like with other methods, we just change it and go with dot and then

15
00:01:05,650 --> 00:01:08,970
bar blue light and learn instead of the object.

16
00:01:08,970 --> 00:01:10,920
We want to pass into two things.

17
00:01:11,400 --> 00:01:13,110
What we want to reference.

18
00:01:14,120 --> 00:01:18,530
I meant what properties we want to get, so here we go with baths.

19
00:01:19,040 --> 00:01:23,720
And of course, this needs to match whatever we have in the model.

20
00:01:24,020 --> 00:01:24,410
Correct.

21
00:01:24,800 --> 00:01:32,750
So if I take a look at the review model here, where is the product sitting right here?

22
00:01:33,230 --> 00:01:36,890
So I want to reference this model.

23
00:01:37,160 --> 00:01:45,170
And therefore, I go with Bath and we set it up as a product of one comma and then we go to select shown

24
00:01:45,170 --> 00:01:45,530
here.

25
00:01:45,710 --> 00:01:48,230
I want to say what properties I want to get.

26
00:01:48,800 --> 00:01:54,950
And of course, it does make sense to get the actual product properties you want to double check them.

27
00:01:55,280 --> 00:01:58,190
Go to the model and you'll be able to find them.

28
00:01:58,340 --> 00:01:59,840
In my case, what am I looking for?

29
00:02:00,080 --> 00:02:01,130
I want to go with name.

30
00:02:02,140 --> 00:02:02,980
One company.

31
00:02:04,100 --> 00:02:06,350
And also a price.

32
00:02:06,440 --> 00:02:07,820
Let's save it.

33
00:02:08,270 --> 00:02:12,500
Let's go back and then once we send it, check it out.

34
00:02:12,980 --> 00:02:18,870
Not only I get the I.D., but I also have name, price and company.

35
00:02:19,610 --> 00:02:21,620
And you probably have two questions.

36
00:02:21,860 --> 00:02:25,580
First, can we do the same thing with user?

37
00:02:25,940 --> 00:02:26,570
Yes, of course.

38
00:02:27,580 --> 00:02:28,430
Take this whole thing.

39
00:02:29,710 --> 00:02:37,990
And copy and paste instead of product for user, and my gosh, I'm going to go with just name.

40
00:02:38,380 --> 00:02:39,040
Let's save it.

41
00:02:39,580 --> 00:02:43,750
Send it online instead of just user I.D..

42
00:02:44,170 --> 00:02:45,550
I also have the name.

43
00:02:46,060 --> 00:02:47,320
So in my case, I remove it.

44
00:02:47,620 --> 00:02:49,720
Let's keep in mind that you can keep it there.

45
00:02:50,020 --> 00:02:55,000
Second question Can you use it, for example, on getting all of you?

46
00:02:55,420 --> 00:02:55,870
Of course.

47
00:02:56,470 --> 00:02:57,160
Same deal.

48
00:02:57,400 --> 00:02:58,360
You already know the steps.

49
00:02:58,810 --> 00:03:01,720
You're the populate and you'll get the info.

