1
00:00:00,300 --> 00:00:05,550
All right, and once we have covered how we can select certain fields next I want to show you how we

2
00:00:05,550 --> 00:00:14,040
can skip and limit and by using both of those things and actually set up a option for the user to choose

3
00:00:14,040 --> 00:00:14,850
a page.

4
00:00:15,350 --> 00:00:16,840
Now, how is that going to look like?

5
00:00:16,860 --> 00:00:22,320
Well, in our final project, you can go here with Limit and then just decide how many products you

6
00:00:22,320 --> 00:00:22,970
want to get back.

7
00:00:23,220 --> 00:00:25,730
And I believe, again, we have twenty three products.

8
00:00:26,100 --> 00:00:30,150
So of course if you'll go with 30, then we'll just get all of them.

9
00:00:30,420 --> 00:00:36,180
So just to showcase that now of course now we have twenty three part if I'm going to go less so if I'm

10
00:00:36,180 --> 00:00:42,900
going to go limit online for example for then of course I'll get only four items and if I don't pass

11
00:00:42,900 --> 00:00:46,300
anything in then of course by default we'll get ten.

12
00:00:46,440 --> 00:00:49,830
That's why we have a number of hits and that is equal to 10.

13
00:00:50,220 --> 00:00:51,540
So hopefully that is clear.

14
00:00:51,720 --> 00:00:57,840
And as far as getting the correct page, just like they have over here where you pass in the page and

15
00:00:57,840 --> 00:01:05,580
that is going to return, that exact page number will have to combine limit with Skip, which is another

16
00:01:05,580 --> 00:01:06,510
option we have.

17
00:01:06,720 --> 00:01:12,740
And before we go any further, let me just showcase how is that going to look like in our manual setup?

18
00:01:13,050 --> 00:01:15,960
So in here, I think I'm going to stick with select.

19
00:01:16,200 --> 00:01:19,140
I mean, it doesn't really matter.

20
00:01:19,350 --> 00:01:22,970
And that as far as limit, we simply need to go with a method.

21
00:01:22,980 --> 00:01:24,540
And again, we change it.

22
00:01:24,780 --> 00:01:28,260
And hopefully by now it's clear that can get all product.

23
00:01:28,590 --> 00:01:32,270
We'll have to do that before we await for the result.

24
00:01:32,490 --> 00:01:35,140
And then in here, we simply need to pass in the value.

25
00:01:35,490 --> 00:01:42,000
So if I want to limit my response here to four, then of course I can go back to the postman.

26
00:01:42,150 --> 00:01:43,770
Now I'm looking for a static one.

27
00:01:44,010 --> 00:01:48,030
I send it and of course I'm only going to get four of them.

28
00:01:48,200 --> 00:01:54,960
Now, if this value is going to be bigger than all the items I have, cause I'm just going to get all

29
00:01:54,960 --> 00:01:57,810
the items that I have in my list.

30
00:01:58,170 --> 00:02:01,080
And essentially Skip works exactly the same way.

31
00:02:01,500 --> 00:02:06,740
But the difference is that it just skips the first items in the response.

32
00:02:07,050 --> 00:02:13,630
So let me just limit this by 10 and I'll make sure that we actually saw A to Z.

33
00:02:13,800 --> 00:02:17,310
So that way, of course, you can see exactly what we're getting back.

34
00:02:17,500 --> 00:02:21,420
So let me go here and I'll change that sort.

35
00:02:21,720 --> 00:02:24,660
And I'm just going to be looking for the name.

36
00:02:24,960 --> 00:02:30,960
And of course, now we have a setup where we're alphabetically sorting our responses as well.

37
00:02:31,140 --> 00:02:35,730
And in order to show you how so it works, first, let's take a look at our basic response.

38
00:02:35,970 --> 00:02:42,090
So if we go here now, I'm getting 10 items correct because of that is my limit.

39
00:02:42,330 --> 00:02:45,870
And then I start with this item and then I have the next one.

40
00:02:45,870 --> 00:02:46,260
Next one.

41
00:02:46,260 --> 00:02:46,670
Next one.

42
00:02:46,950 --> 00:02:49,080
So if I'm going to go here with Skip.

43
00:02:49,890 --> 00:02:57,300
And for starters, I'm just going to skip one notice that, of course, now we start with our second

44
00:02:57,300 --> 00:02:57,690
item.

45
00:02:58,170 --> 00:03:05,490
So the item that was second in a previous response, and if we keep making it bigger, you can probably

46
00:03:05,490 --> 00:03:11,270
already guess that we're just going to be shipping the items in our response.

47
00:03:11,640 --> 00:03:18,750
So now, of course, we right away start with a letter B, and once we understand the manual approach

48
00:03:19,050 --> 00:03:22,580
now, of course, we'll have to implement that and get all product.

49
00:03:23,140 --> 00:03:27,390
The goal is to use skip and limit to set up a pagination functionality.

