WEBVTT

00:00.480 --> 00:10.800
Hey everyone, in this video I will show you how we can do the bisimulation for the post.

00:11.040 --> 00:14.640
Okay, I want to do it similar with the five books.

00:14.880 --> 00:19.200
Our review infinite scroll right in the front end.

00:19.240 --> 00:24.640
I will show you how we can integrate us right now let's focus in the API part.

00:25.280 --> 00:29.840
So how do we do that?

00:31.240 --> 00:41.320
Well, if you know Azure you already know, uh, something like language and vice versa right.

00:41.320 --> 00:44.120
Like that okay.

00:44.120 --> 00:47.680
It will do some visualization using this way.

00:48.760 --> 00:55.680
But it's not good for those application right now okay.

00:58.440 --> 01:04.070
If you remember in MongoDB we have some method to do the skip.

01:05.790 --> 01:11.990
Let me say right here we have something called skip.

01:12.270 --> 01:12.830
Okay.

01:13.070 --> 01:24.910
And we have a limit also with this approach it very bad performance when we use the skip over here okay.

01:25.150 --> 01:29.830
And it not good for infinite scroll.

01:30.350 --> 01:32.590
So for that reason we need to another way.

01:34.070 --> 01:34.550
Okay.

01:34.590 --> 01:37.790
Right now let me show you how we can do that.

01:38.630 --> 01:40.150
I want to do similar.

01:40.630 --> 01:42.590
First of all right here we have a limit.

01:43.030 --> 01:43.550
Okay.

01:43.750 --> 01:45.430
Maybe I remove the limit one.

01:46.030 --> 01:57.670
And when I find that I will start from decrement with the created add.

01:59.380 --> 01:59.900
okay.

02:01.020 --> 02:01.620
Possible.

02:01.660 --> 02:04.900
Right here and right here.

02:06.140 --> 02:06.860
Let me say.

02:10.180 --> 02:10.740
Okay.

02:10.740 --> 02:14.500
This here will be the new one.

02:14.540 --> 02:14.820
Okay.

02:14.860 --> 02:16.860
So for that reason, we need to shortly.

02:16.860 --> 02:18.940
But first let me show you.

02:18.980 --> 02:20.300
Firstly I will show.

02:28.860 --> 02:32.380
Up with a minus one.

02:37.260 --> 02:39.460
Uh, actually I will.

02:42.620 --> 02:43.620
So let us.

02:46.620 --> 02:47.180
Okay.

02:47.740 --> 02:48.500
Let me say.

02:56.010 --> 02:58.370
This year will be the new one.

02:58.410 --> 03:00.050
It later I will add the limit.

03:00.050 --> 03:10.690
For example, I limit one okay I will, it will take one recourse and I will take a look at the created

03:10.730 --> 03:11.450
order here.

03:11.930 --> 03:17.130
I will copy that and I will put that inside the cursor cursor.

03:20.210 --> 03:21.210
With something like this.

03:21.650 --> 03:33.210
And I will say after I say I will file with the less than operator to file the another object.

03:33.250 --> 03:33.770
Okay.

03:34.210 --> 03:36.250
Right now it is not clear.

03:36.730 --> 03:42.090
I will show you it got and I will explain okay.

03:42.210 --> 03:44.290
Don't worry if you don't understand right now.

03:44.290 --> 03:46.170
Firstly we need the source right?

03:46.730 --> 03:48.610
And we need the limits also.

03:51.810 --> 03:52.370
And.

03:55.560 --> 03:55.880
Um.

04:00.560 --> 04:01.600
We will screen.

04:03.800 --> 04:07.080
Memory limits will be ten bucks.

04:08.320 --> 04:08.840
Okay.

04:09.120 --> 04:12.160
And I will fix the controller a little bit inside the box.

04:12.160 --> 04:14.000
Controller over here.

04:16.240 --> 04:17.080
Inside.

04:17.080 --> 04:19.000
Get get all.

04:19.600 --> 04:22.720
We need to vote with the query.

04:24.680 --> 04:25.240
Okay.

04:25.560 --> 04:26.640
We will request.

04:28.840 --> 04:30.480
And request right here.

04:31.840 --> 04:39.560
We raise the bar and make sure this is the number we can pass into the pie.

04:42.680 --> 04:43.200
Okay.

04:43.920 --> 04:45.600
We need to move the limits over here.

04:46.000 --> 04:48.320
And one more thing will be the cursor.

04:49.240 --> 04:49.800
Cursor.

04:52.080 --> 04:53.340
I will remove Here.

04:57.860 --> 04:58.460
We go.

05:07.780 --> 05:11.060
I knew that if I won, let me go solo for you.

05:11.100 --> 05:12.420
What is the limit?

05:17.020 --> 05:17.540
Limit?

05:18.180 --> 05:18.620
And.

05:27.580 --> 05:30.500
From here, if I send with this information.

05:30.820 --> 05:32.380
Okay, this is the query.

05:32.580 --> 05:33.060
Okay.

05:33.980 --> 05:37.340
Let's say right here, you can say we have a limit.

05:37.340 --> 05:43.620
And right by this information I will show you we have a source.

05:43.660 --> 05:45.620
We have a limit.

05:48.020 --> 05:51.730
Right now I will limit with the limit right here.

05:52.850 --> 05:54.530
And I will block one.

05:55.210 --> 05:58.490
And I will show you why we need the plus one right here.

05:58.890 --> 05:59.490
Don't worry.

06:01.250 --> 06:02.050
After that.

06:05.490 --> 06:07.210
We need the cross value.

06:07.850 --> 06:15.250
So now we have a hash list by a not okay with this thing I will drag a box.

06:15.890 --> 06:16.810
Not length.

06:17.730 --> 06:21.490
Right run limit between.

06:21.530 --> 06:24.770
Right here we have list by right.

06:25.530 --> 06:27.050
And I will create an item.

06:28.890 --> 06:31.850
The item we will have box.

06:39.090 --> 06:40.330
We have set by.

06:41.250 --> 06:48.410
If we have a hardness by we will use a box not slide we will remove.

06:52.000 --> 06:53.720
The one from here.

06:54.960 --> 06:58.080
And if not, we need to get the boss over here.

06:58.120 --> 07:05.120
Okay, we already have a fast paced and agile, and in here we need to move a little bit.

07:05.160 --> 07:05.960
One more thing.

07:06.520 --> 07:08.640
We need to check if the cursor.

07:09.320 --> 07:12.520
Is it okay, because, uh.

07:12.760 --> 07:13.400
Is it?

07:14.080 --> 07:17.920
We need to create a victory for us.

07:22.760 --> 07:25.480
Where are we going to object?

07:30.600 --> 07:38.080
I will put a little bit of script over here where we not created equal.

07:41.280 --> 07:46.800
Let's not put a new line and move the cursor over here.

07:49.270 --> 07:49.790
Okay.

07:50.550 --> 07:58.270
And with the file method I will move that to.

08:00.790 --> 08:04.270
I will move that over here right away.

08:14.470 --> 08:19.230
And right now let me explain for you what actually happened right now.

08:20.110 --> 08:23.150
Firstly not all this line.

08:23.190 --> 08:26.030
Let me explain for you why we need two plus one.

08:26.350 --> 08:31.670
We need two plus one because we want to check it has next bye or not.

08:31.710 --> 08:32.230
Right.

08:32.590 --> 08:35.870
For example, in here the boss right here is a limit.

08:35.870 --> 08:38.550
Plus one possible limit will be ten.

08:38.790 --> 08:39.270
Okay.

08:39.790 --> 08:43.990
Ten plus one will be 11 and 11.

08:44.030 --> 08:52.540
Also greater than Then Roy followed by Ruby become Joe and we call it Joe.

08:52.860 --> 08:59.900
So for reasons we will extract from 1111 into the ten element, okay.

09:00.020 --> 09:10.260
It means this line here it will be somehow got the one last element from the boss below here.

09:10.300 --> 09:13.420
Because over here we start 11 element right.

09:13.660 --> 09:15.260
So what is this guy?

09:15.780 --> 09:18.180
We need to remove the last one.

09:19.420 --> 09:19.940
Okay.

09:20.660 --> 09:23.180
That is with this ten.

09:23.220 --> 09:24.420
We can check it out.

09:24.460 --> 09:26.100
Let's buy another an item.

09:26.580 --> 09:29.300
And what is the final method right here.

09:30.500 --> 09:31.820
Well, let me show you.

09:34.300 --> 09:35.060
First one.

09:36.580 --> 09:39.380
Um, certainly.

09:39.940 --> 09:41.020
For example.

09:44.100 --> 09:53.610
If we put the cursor right here, it means we want to do some visualization, right?

09:53.650 --> 09:58.450
We want to pagination between right here we have a cursor.

09:58.970 --> 10:04.650
And we will create a query for that cursor using the less than operator.

10:04.930 --> 10:05.250
Okay.

10:05.290 --> 10:08.730
First of all right now is uh.

10:14.290 --> 10:14.730
Here.

10:17.130 --> 10:17.570
Okay.

10:17.770 --> 10:20.290
First of all this is the some days okay.

10:20.330 --> 10:24.930
For example, this is the some timestamp or some days right here.

10:25.410 --> 10:33.770
Firstly we will show we will show by from top to bottom something like this.

10:33.770 --> 10:34.210
Right.

10:36.210 --> 10:39.250
With this field it will start something like that.

10:39.850 --> 10:42.330
And first of all with the limit will be one.

10:42.890 --> 10:45.600
First of all, we would limit we reward whatever.

10:46.080 --> 10:51.560
If the limit will be one, it will only return that this line.

10:51.600 --> 10:52.040
Okay.

10:52.320 --> 10:55.520
And we remove this line to the closure to very less.

10:55.520 --> 11:03.400
Let me show you what exactly that right now I remove the limit will be one because right here we only

11:03.400 --> 11:05.600
have two document.

11:07.080 --> 11:07.640
Okay.

11:08.720 --> 11:14.320
Right here I will say, uh, if we don't put anything, let's say.

11:17.080 --> 11:18.280
Validation fail.

11:23.880 --> 11:25.560
Or the reason?

11:25.560 --> 11:28.960
Because right here it is.

11:29.280 --> 11:34.120
Uh, empty string right here.

11:34.120 --> 11:40.520
We need to put over here and let me remove.

11:41.080 --> 11:41.950
We don't need that.

11:42.110 --> 11:42.510
So.

11:47.990 --> 11:49.750
Let me show you what exactly?

11:49.750 --> 11:50.150
That.

12:03.830 --> 12:08.590
Uh, but before that, let me use that.

12:09.430 --> 12:11.830
Instead of using the box, I will using the icon.

12:13.030 --> 12:13.550
Okay.

12:14.390 --> 12:21.510
And, uh, instead of return here, I will return the box with the K.

12:25.070 --> 12:26.030
And pass.

12:27.230 --> 12:28.030
Let's marry.

12:30.110 --> 12:30.390
And.

12:33.470 --> 12:36.310
Okay, let me show you.

12:36.910 --> 12:37.470
What?

12:40.970 --> 12:41.650
Let me say.

12:44.090 --> 12:46.370
Uh, we have some error.

12:48.250 --> 12:49.810
Numeric number.

12:51.290 --> 12:52.010
Integer.

12:57.650 --> 13:03.170
Limit one to say we have our internal several.

13:06.490 --> 13:08.530
Override our internal server.

13:09.730 --> 13:15.210
Because right here we have a complete the transform detail.

13:15.250 --> 13:20.450
Let let me comment that also I will show you how we can fix that.

13:25.730 --> 13:32.450
Now let's say if I say we the limit will be one, we only get the one thing okay.

13:33.530 --> 13:41.440
And right here we don't have a cursor, All right, we need to return the cursor.

13:41.840 --> 13:44.880
Also the cursor right here.

13:44.880 --> 13:46.680
It will come from the last item.

13:47.360 --> 13:48.040
The last item.

13:48.080 --> 13:48.880
Let me show you.

13:51.480 --> 13:57.640
Sorry about the lag one dot created, huh?

13:58.280 --> 13:58.640
Okay.

13:58.640 --> 14:02.800
We need to return the cursor from the last one.

14:04.840 --> 14:10.640
Right now it's a created app dot exit on file right here.

14:11.880 --> 14:13.480
What about the schema?

14:14.040 --> 14:15.880
The reason we call the boss right here.

14:15.920 --> 14:20.720
It don't have created app field.

14:21.400 --> 14:24.800
So I think I will provide right here.

14:25.120 --> 14:25.640
Okay.

14:26.440 --> 14:28.360
We already have a timestamp.

14:28.360 --> 14:28.840
Right.

14:29.560 --> 14:31.360
But let us.

14:36.710 --> 14:38.950
Only for TypeScript once.

14:39.150 --> 14:42.190
We don't need to boost the problem here.

14:42.470 --> 14:42.950
Okay.

14:43.110 --> 14:46.870
Because we already have a timestamp from the schema.

14:47.270 --> 14:47.590
Okay.

14:47.630 --> 14:49.910
This is just add a little bit of TypeScript.

14:50.990 --> 14:52.990
Now it will fit TypeScript right?

14:53.390 --> 14:54.350
Let me show you.

14:55.430 --> 15:00.030
Now you can see this is the cursor right.

15:00.070 --> 15:04.110
I want it will return the cursor for me.

15:04.950 --> 15:05.470
Okay.

15:05.750 --> 15:07.590
Now you can see this is the cursor.

15:08.630 --> 15:08.910
Okay.

15:08.910 --> 15:09.910
This is the cursor.

15:10.510 --> 15:10.950
Right.

15:11.510 --> 15:17.830
And in the next one, in order to vaccination I will put the cursor right here.

15:21.510 --> 15:27.590
In the stage and say now you can say with certainty it will return from another culture.

15:27.830 --> 15:30.910
And right now the database will be full.

15:30.950 --> 15:35.380
This means we don't have any bias anymore, right?

15:35.980 --> 15:44.020
So with this approach we can create the pagination using the cursor technique.

15:44.060 --> 15:46.620
And it's very good for performance.

15:47.540 --> 15:56.180
But what if and if you don't understand my explanation please check out the code.

15:56.340 --> 16:01.740
And I'm sure you will because it doesn't hurt at all, right?

16:02.740 --> 16:06.220
So it still is a right.

16:07.500 --> 16:09.220
It's just the whole idea.

16:09.620 --> 16:17.100
We need to leverage and shortcut using the created art field.

16:17.860 --> 16:19.700
Okay, to do the pagination.

16:21.100 --> 16:22.660
And one more thing.

16:22.660 --> 16:25.860
We need to fix the radio.

16:27.700 --> 16:28.700
Let me open again.

16:42.930 --> 16:50.090
GitHub internal server error because in the most of it we already return the object.

16:50.130 --> 16:50.610
Okay.

16:51.410 --> 16:56.970
So we need to configuration a little bit inside Respondto.

16:57.330 --> 16:59.890
Also inside the transform DTO.

16:59.930 --> 17:02.690
Over here we have a map.

17:03.210 --> 17:04.970
Right now let me console.log.

17:04.970 --> 17:06.690
What is inside the data.

17:27.250 --> 17:30.890
Right here we have a little bit error.

17:31.880 --> 17:36.320
High altitude sky, which we should call.

17:36.320 --> 17:50.080
This will be the data because for example, in in later if we have another uh, resource can pagination.

17:50.360 --> 17:53.280
If we do the post we cannot reduce that.

17:53.640 --> 17:54.080
Okay.

17:54.320 --> 17:57.040
But let me show you what exactly what I mean.

17:57.080 --> 18:01.680
For example, right here I will use the boss and inside the chart for me.

18:01.680 --> 18:04.520
So let me go for use.

18:06.360 --> 18:07.320
I will say it again.

18:08.640 --> 18:12.560
We got the error but we already get the data right.

18:14.680 --> 18:21.240
So here we will based on this field to know which will be the visualization or not, I will just give

18:21.240 --> 18:24.120
the data has own property.

18:26.920 --> 18:37.310
We will pass next by if it has led by it means this is the end point for the pagination, right?

18:37.350 --> 18:39.790
So for that reason we need to return over here.

18:41.430 --> 18:45.150
And uh data.

18:45.190 --> 18:47.630
Data right here.

18:47.630 --> 18:49.030
We need to destructuring.

18:56.030 --> 19:00.550
Now for our data we have a post right.

19:00.590 --> 19:15.750
We would go here and we need to pass the past next by and closure over here.

19:21.550 --> 19:21.950
Right.

19:21.950 --> 19:22.950
Something like that.

19:23.510 --> 19:25.150
And we have some error.

19:26.270 --> 19:31.340
We we need to use Roberto Tato has own property.

19:32.140 --> 19:32.460
Okay.

19:32.500 --> 19:32.900
Okay.

19:33.660 --> 19:37.260
We can use object dot.

19:37.260 --> 19:44.020
Prototype dot has own property and we can call.

19:46.580 --> 19:53.980
Him with the data and the field will be displaced by.

19:54.340 --> 19:54.620
Okay.

19:54.660 --> 19:56.740
It is exactly the same as before.

19:57.100 --> 20:00.060
But this is the better in JavaScript.

20:06.220 --> 20:07.180
Let me say it again.

20:09.380 --> 20:11.340
Now we already got message.

20:11.540 --> 20:11.940
Okay.

20:11.980 --> 20:18.740
And we already provide a field for husk nest base and closure okay.

20:20.860 --> 20:23.300
So this is what happens if I move this thing.

20:23.460 --> 20:23.940
So.

20:29.850 --> 20:32.810
Okay, we got the internal server error.

20:37.930 --> 20:41.050
Let me test again a little bit more here.

20:41.770 --> 20:42.410
It's work.

20:42.450 --> 20:45.330
But if I move the cursor over here.

20:47.770 --> 20:51.970
So what it is that we need to check a little bit over here.

20:53.130 --> 20:56.330
Let's say we cannot wait for the uploaded file.

20:59.570 --> 21:00.170
Right.

21:00.730 --> 21:07.730
So for that reason, we need to check if has led by a withdrawal.

21:08.210 --> 21:10.930
We will have a created app.

21:10.970 --> 21:13.810
If not, we can put a note over here.

21:25.050 --> 21:26.790
So it was more better.

21:27.070 --> 21:29.350
And I think this will be very enough.

21:30.190 --> 21:30.670
Okay.

21:30.710 --> 21:34.630
You can check that if you want.

21:35.510 --> 21:38.190
You can add a little bit of validation if you want.

21:38.230 --> 21:41.590
But I think now you got the idea right.

21:41.990 --> 21:42.830
So let's see what.

21:42.830 --> 21:46.990
That's it and try to understand that.

21:47.990 --> 21:51.190
And uh with this thing it's very easy, right?

21:52.550 --> 21:53.950
We just need to add a little bit.

21:54.390 --> 21:59.710
But like I said, if we call this here will be the post.

22:00.190 --> 22:03.470
It cannot reduce it later.

22:03.990 --> 22:04.510
Right.

22:04.950 --> 22:10.870
Because for example, in later we have uh.

22:13.910 --> 22:20.870
For example like the user roles or command or something like that.

22:21.590 --> 22:22.110
Okay.

22:22.230 --> 22:30.900
How do we Reviews so far is that we need to rename a little bit and in later make sure we always use

22:30.900 --> 22:31.540
nickname.

22:31.860 --> 22:36.060
I will call the items and right here we check it to.

22:38.620 --> 22:39.100
Boost.

22:39.100 --> 22:42.100
The item over here is much more better right?

22:43.700 --> 22:45.340
This is the generic name.

22:46.020 --> 22:46.540
Okay.

22:50.620 --> 22:53.340
Let me say this.

22:53.340 --> 22:55.780
The work pathway is okay.

22:59.500 --> 23:01.660
And right now we have one more problem.

23:03.700 --> 23:09.140
If we don't put anything inside here.

23:11.540 --> 23:17.300
It will console.log the empty string.

23:33.650 --> 23:36.090
So the reason is very simple.

23:36.450 --> 23:42.090
The reason because the validation rule before it adds the default value.

23:42.410 --> 23:50.650
So validation before routine we can move the default value higher.

23:51.290 --> 23:51.810
Okay.

23:52.570 --> 23:54.450
We can move the new operator.

23:55.610 --> 23:56.330
Let me say.

23:59.010 --> 24:02.250
We value we can move ten over here.

24:03.090 --> 24:06.010
And let's try to remove that.

24:09.650 --> 24:16.410
If we don't put anything let's say let y be same again.

24:17.770 --> 24:18.210
Okay.

24:18.210 --> 24:20.610
We already got information.

24:20.960 --> 24:23.840
and hustled by for sure will be false.

24:23.880 --> 24:26.200
And Kershaw will be low.

24:26.240 --> 24:26.760
Right.

24:32.480 --> 24:33.160
Now is.

24:37.880 --> 24:39.920
Let me test one more time.

24:40.600 --> 24:48.080
Will make only one say we got to console and that will be true.

24:48.720 --> 24:50.120
Put the console over here.

25:02.720 --> 25:03.280
Okay.

25:05.480 --> 25:07.400
This orderly woke up.

25:07.400 --> 25:08.360
We spotted.

25:09.080 --> 25:12.040
And thus, for the video.

25:12.240 --> 25:17.880
I hope you understand and talk a little bit of time to understand.

25:19.320 --> 25:20.040
I will see you.
