Тёмный
No video :(

Complete MongoDB Tutorial #23 - Pagination 

Net Ninja
Подписаться 1,6 млн
Просмотров 59 тыс.
50% 1

Hey gang, in this MongoDB tutorial I'll explain how to implement pagination into your requests.
🐱‍💻 View this course & other premium courses without ads on the Net Ninja Pro site:
net-ninja-pro....
🐱‍💻 Access the course files on GitHub:
github.com/iam...
(lesson code available from lesson 15 onwards)
🐱‍💻 Modern JavaScript Course:
On Net Ninja Pro - netninja.dev/p...
On Udemy - www.thenetninj...
On RU-vid - • Modern JavaScript Tuto...
🐱‍💻 Node.js Crash Course:
On Net Ninja Pro - netninja.dev/p...
On RU-vid - • Node JS Tutorial for B...
🐱‍💻 VS Code - code.visualstu...
🐱‍💻 Download MongoDB - www.mongodb.co...

Опубликовано:

 

6 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 50   
@dylanstephens1222
@dylanstephens1222 2 года назад
Awesome tutorial man. However, is there ANY possibility of you doing a cursor based pagination tutorial? The skip/limit method is good, but not exactly efficient.
@pouyajamali6779
@pouyajamali6779 11 дней назад
One of the best tutorials i have ever watched thanks.
@NetNinja
@NetNinja 11 дней назад
Glad it was helpful! :) thanks
@sjtrader1363
@sjtrader1363 Год назад
Beautiful. All what I needed, explained in just 7 minutes.
@grandorottcod1
@grandorottcod1 20 дней назад
For parallel calls, can you take the count of the collection in the first request and build the pages off that?
@towatch
@towatch 2 года назад
You're a legend ♥️, we can't thank you enough.
@hafezfhmi
@hafezfhmi 2 года назад
You're the best channel to learn coding!
@_Dhruv-nj8dk
@_Dhruv-nj8dk 2 года назад
Thank You for this amazing video man!!! So nicely explained. Thanks a lot!
@syncingdata3560
@syncingdata3560 2 года назад
This was an amazing explanation to pagination.
@atmaramkambli7800
@atmaramkambli7800 6 месяцев назад
I love the way you teach❤ You're Genius!!
@NetNinja
@NetNinja 6 месяцев назад
Thank you! 😃
@ZombieBrainz
@ZombieBrainz 2 года назад
Great work. Question - are you not fetching all the books with your find() and then filtering down? If you had 10K books, would you not be bringing them all over and only showing 3? Thanks mate
@aiyushbedi
@aiyushbedi 2 года назад
Thanks for amazing tuturial shaun. Can you also include other useful parameters for the frontend like totalRecords and totalPages which can be sent to create pagination?
@yumindev
@yumindev Год назад
I think you should skip (page -1 ) * booksPerPage. For example, if the page is 5 and there are 3 books per page, you should skip 4 * 3 , instead of 5 * 3.
@art1co
@art1co Год назад
pages starts at 0 so the tutorial is correct, at page 0 you skip none 0*3, at page 1 you skip 1*3, ie the previues page only, and so on
@yumindev
@yumindev Год назад
@@art1co ok, I see. But that’s weird
@yahyarechaki9908
@yahyarechaki9908 Год назад
I agree with you, that it should be (page -1) * booksPerPage, but in this case in this tutorial the pages starts at 0, so what he did is also right.
@pauloluguenda8397
@pauloluguenda8397 6 месяцев назад
You are the goat
@agreensh
@agreensh 2 года назад
Isn't it normal to have the current page returned, and the total number of pages, in the response JSON?
@nir8924
@nir8924 2 года назад
you're correct. to do that you need to run the same query again but to get a document count instead of actually fetchin results and then you can calculate the total njmber of pages etc.
@agreensh
@agreensh 2 года назад
@@nir8924 No, not really. Api's that return paginated data are normally designed to return the current page, the total number of pages (and number of items per page, which you can normally pass as another parameter), as well as the actual data in one call.
@nir8924
@nir8924 2 года назад
@@agreensh that's exactly what I was saying. It is normal to get all the data like you say. But in order to get the total count of items / pages you need a second query to the database (not a second API call)
@manumore345
@manumore345 Год назад
perfectly explained and very briefly, well done
@NetNinja
@NetNinja Год назад
Thanks Manu!
@jampietri583
@jampietri583 Год назад
Man. you're a genius!
@andromilk2634
@andromilk2634 5 месяцев назад
If I remember correctly from one your videos and correct me if I'm wrong but doesn't MongoDB return you by default a limit of documents? (around 100 I think) You said Mongo does not send you all the documents at once because this would put a strain on the bandwidth if your quantity of documents was huge.
@code_kraft7
@code_kraft7 Год назад
amazing MAN💗💗
@NetNinja
@NetNinja Год назад
Thanks Manu!
@apolomoraes1767
@apolomoraes1767 Год назад
in your example add 3 more books and the previous ones disappear, how would you keep the previous 3 and make 3 more appear? getting a total of 6
@zainulkhan8381
@zainulkhan8381 Год назад
Great explanation
@marekmarszaek3782
@marekmarszaek3782 Год назад
so simple and so beautiful, Thank you :)
@NetNinja
@NetNinja Год назад
Thanks Marek!
@shabi037
@shabi037 Год назад
Thanks for this video ☺️. Do you also have any video for pagination in react frontend with this api?
@VillageWildAdventures
@VillageWildAdventures 8 месяцев назад
Tnx a lot bro
@abdellahiaioun8430
@abdellahiaioun8430 9 месяцев назад
Thank you
@saharghoniem1348
@saharghoniem1348 Год назад
you are amazing
@andTutin
@andTutin 2 года назад
how do i know how many buttons for pages should i do?
@anupkhismatrao9280
@anupkhismatrao9280 2 месяца назад
@kishansheth9498
@kishansheth9498 2 года назад
Hey there I think you've got a wrong title for this video, the number should be 23 not 13
@NetNinja
@NetNinja 2 года назад
Sorted, thanks :)
@siamekanto
@siamekanto 2 года назад
does this pagination technique scale?
@afrikanking4022
@afrikanking4022 2 года назад
Failing to Join channel transaction keeps getting declined
@stroverbg
@stroverbg 2 года назад
Change the title from 13 to 23
@webpapi
@webpapi Год назад
YES, yes it does make sense. lol
@Pareshbpatel
@Pareshbpatel 6 месяцев назад
{2024-02-29}
@Robytsu
@Robytsu Год назад
To be honest.... This was extremely basic
@akshayshinde2403
@akshayshinde2403 Год назад
want to unsubscribe others and only follow your channel. Do you have your discord server? Your videos are very concise and clean.
@anything1873
@anything1873 Год назад
pagination didn't work with me! did it work with you?
@akshayshinde2403
@akshayshinde2403 Год назад
@@anything1873 yes, what's the issue u r facing?
Далее
Complete MongoDB Tutorial #24 - Indexes
6:44
Просмотров 84 тыс.
MongoDB Crash Course
29:59
Просмотров 680 тыс.
How to get Spongebob El Primo FOR FREE!
01:36
Просмотров 15 млн
No-Nonsense Backend Engineering Roadmap
10:16
Просмотров 195 тыс.
Easy Pagination With MongoDB & React.js
17:18
Просмотров 10 тыс.
Create A Paginated API With Node.js - Complete Tutorial
23:21
Web API Pagination | Offset-based vs Cursor-based
11:03
Pagination in MySQL - offset vs. cursor
13:20
Просмотров 57 тыс.
Pydantic Tutorial • Solving Python's Biggest Problem
11:07