1
00:00:00,520 --> 00:00:06,790
And once the search functionality is in place next, I want to showcase how we can select certain fields

2
00:00:07,210 --> 00:00:13,750
and I think the easiest way for me to show you that is going through the final project and then I'm

3
00:00:13,750 --> 00:00:15,430
just going to go with Fields.

4
00:00:15,440 --> 00:00:16,320
So that's the key.

5
00:00:16,630 --> 00:00:19,030
Please keep in mind that's something that I made up.

6
00:00:19,510 --> 00:00:21,300
The actual method name is different.

7
00:00:21,550 --> 00:00:25,390
It is select, but in the query variables, we set up fields.

8
00:00:25,630 --> 00:00:28,510
So this is just going to showcase which fields we want to see.

9
00:00:28,760 --> 00:00:35,320
And as far as the values, the same as with sort, we simply need to pass here the properties that are

10
00:00:35,320 --> 00:00:36,160
in our schema.

11
00:00:36,550 --> 00:00:44,770
And my since I want to see only the name property and only the price, I'll type name price and hopefully

12
00:00:44,770 --> 00:00:45,460
you get the gist.

13
00:00:45,850 --> 00:00:51,150
If you want to see some other properties, just add comma and find the actual property.

14
00:00:51,400 --> 00:00:52,480
So let's go over here.

15
00:00:52,700 --> 00:00:58,060
And of course you can see that in my response, I only have the idea which is going to be by default

16
00:00:58,330 --> 00:01:01,210
as well as the name and price.

17
00:01:01,510 --> 00:01:06,310
And if we take a look at the docs, we can see that the method name is select.

18
00:01:06,700 --> 00:01:14,140
And again, we have these multiple options where if you want to go with just trying and simply say select

19
00:01:14,410 --> 00:01:16,540
and then pass in the properties.

20
00:01:16,850 --> 00:01:18,780
So let's try it out in our static one.

21
00:01:19,630 --> 00:01:20,530
So let's move up.

22
00:01:20,830 --> 00:01:27,110
We have to sort I think I'm going to remove the sword for now and we'll just say select and line in

23
00:01:27,130 --> 00:01:27,430
here.

24
00:01:27,430 --> 00:01:28,360
I'll do the same thing.

25
00:01:28,360 --> 00:01:30,940
I'll say name and price.

26
00:01:31,480 --> 00:01:38,520
And once we go back to the postman, which is always tough because it's all the way and left on side,

27
00:01:38,530 --> 00:01:39,610
then I keep forgetting that.

28
00:01:40,090 --> 00:01:47,710
Now, of course, notice our response only has these two properties as the two fields of name and price.

29
00:01:48,190 --> 00:01:53,170
And if we want to implement that in get our product, what do we need to do?

30
00:01:53,470 --> 00:01:57,320
Well, first, we need to come up with a name in a query string.

31
00:01:57,370 --> 00:02:03,820
Again, this is what I said before, where when it comes to the query string, you are setting this

32
00:02:03,820 --> 00:02:09,370
up because you'll tell the user and docs, hey, if you want to search for certain fields, then you

33
00:02:09,370 --> 00:02:12,970
need to add this property in the query string parameter.

34
00:02:13,420 --> 00:02:17,560
If you decide that you call the shake and bake, you're in charge.

35
00:02:17,740 --> 00:02:18,910
You can definitely do so.

36
00:02:19,090 --> 00:02:21,130
Now, in my case, I'm not going to be such a rebel.

37
00:02:21,490 --> 00:02:24,160
I'm just going to go with fields of land.

38
00:02:24,160 --> 00:02:27,700
We're going to keep on scrolling at right after this short.

39
00:02:28,030 --> 00:02:33,490
And you're not at this point think it's going to be very useful if I add some comments here and then

40
00:02:33,490 --> 00:02:38,020
right after sort, but before the product, we'll check for the fields again.

41
00:02:38,950 --> 00:02:45,880
We'll see if the field exists, then we'll do the same thing where we want to split them up and of course,

42
00:02:45,880 --> 00:02:49,030
join them back together in the process, will remove that comma.

43
00:02:49,360 --> 00:02:52,920
And then, of course, we just need to change the select method.

44
00:02:53,230 --> 00:02:57,280
So in this case, in order to speed this up, I'm just going to copy and paste.

45
00:02:57,560 --> 00:03:01,780
This is not going to be a short list of Caldas Fields list.

46
00:03:02,110 --> 00:03:08,180
And instead of sort we're going to be looking for field functionality is going to be exactly the same.

47
00:03:08,210 --> 00:03:10,060
We split it up, we join it back together.

48
00:03:10,240 --> 00:03:14,200
And then as far as the result, of course, I don't want to sort it out anymore more.

49
00:03:14,410 --> 00:03:22,720
I want to use select and I want to pass in the fields list like so so we go over here and let's not

50
00:03:22,720 --> 00:03:24,160
forget you're the postman.

51
00:03:24,490 --> 00:03:27,720
And of course, in this case, we're not looking for a static one anymore.

52
00:03:28,000 --> 00:03:34,450
We want to go with all the product here and then let's just add both of them together.

53
00:03:34,670 --> 00:03:38,910
So I have to sort of keep that one and then I'll create a new key.

54
00:03:39,280 --> 00:03:42,750
I'll call this Fields, Fields and mine.

55
00:03:42,760 --> 00:03:46,390
As far as Devourers, let's just say we're going to be looking for the company.

56
00:03:46,750 --> 00:03:49,930
And also I just want to see derating over here.

57
00:03:50,200 --> 00:03:51,490
So let's pass these through.

58
00:03:51,760 --> 00:03:58,510
And of course, we'll notice that we only get the rating as well as the company in our response.

