Create A Paginated API With Node.js - Complete Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 ก.ย. 2019
  • Pagination is one of the easiest ways to increase the performance of any application you are working on. Luckily setting up pagination is actually pretty simple. In this video I am going to show you the exact process to set up pagination in your own API by going through three distinct steps. First we will build out the most simple pagination set up which will get us started with pagination. After that we will implement a middleware to take care of pagination for use so we can paginate all of our endpoints easily. Lastly, we will connect out paginated API to a MongoDB database so we can have a fully functional paginated API with database storage.
    📚 Materials/References:
    How To Install MongoDB: • How To Install MongoDB...
    GitHub Code: github.com/WebDevSimplified/P...
    🧠 Concepts Covered:
    - How to accept pagination params in an API
    - How to create a pagination middleware
    - Creating a middleware that accepts parameters
    - Paginating a MongoDB collection
    🌎 Find Me Here:
    My Courses: courses.webdevsimplified.com
    Patreon: / webdevsimplified
    Twitter: / devsimplified
    Discord: / discord
    GitHub: github.com/WebDevSimplified
    CodePen: codepen.io/WebDevSimplified
    #Pagination #WDS #API

ความคิดเห็น • 249

  • @hamzahahmad1670
    @hamzahahmad1670 4 ปีที่แล้ว +86

    This channel is criminally underrated. You should have blown up by now. Thank you for the quick and thorough explanations.

    • @WebDevSimplified
      @WebDevSimplified  4 ปีที่แล้ว +23

      Thanks. I feel my channel has already blown up

  • @liorocker1
    @liorocker1 4 ปีที่แล้ว +168

    Video title should be "How to master backend pagination in 24 minutes"... Amazing demo in a very short time, learning with you really rocks man. Thank you :D

    • @WebDevSimplified
      @WebDevSimplified  4 ปีที่แล้ว +34

      Thank you so much! I try to keep my videos as short as possible, even though sometimes they get a bit long like this video. I'm glad you enjoyed every minute of it, though. :)

    • @_.sunnyraj._
      @_.sunnyraj._ 3 ปีที่แล้ว +1

      *rock

    • @ishraq95
      @ishraq95 3 ปีที่แล้ว +4

      @@WebDevSimplified You are great man.. Thanks alot..

    • @mdmohiuddin3141
      @mdmohiuddin3141 3 ปีที่แล้ว +5

      24 minutes for WDS means 1 hour and 30 minutes for other

    • @021bethineedilakshmideepak4
      @021bethineedilakshmideepak4 2 ปีที่แล้ว +1

      @liorocker1 can we program pagination at the front end level?

  • @bastiaand
    @bastiaand 3 ปีที่แล้ว +9

    I appreciate how you dive deeper and show useful VS Code extensions and talk a little about async, await and promises. Great job!

  • @rodrigom.castilho4095
    @rodrigom.castilho4095 3 ปีที่แล้ว +1

    Your didactics are simply amazing, man. It must be the 3rd or 4th time you solve an issue of mine in less than 1/3 of an already short video. AND you managed to solve another unrelated question in the meantime. Holy crap, you're an unsung hero.

  • @Pareshbpatel
    @Pareshbpatel 3 ปีที่แล้ว

    A comprehensive tutorial on the pagination of data fetched from MongoDB. Smoothly and fluently presented. Thank you, Kyle.
    PS This has come very fortuitously when I most needed it! - It simply popped up on my TH-cam Home Page by some weird coincidence. :-)
    {2021-08-17}, {2022-07-16}, {2022-10-12}

  • @xpieceofcakex
    @xpieceofcakex ปีที่แล้ว

    This is quick, to the point, with excellent and easy explanations. Really enjoyed this and all of your videos ive come across. Thank you. Told all my classmates about your channel!

  • @aeroprojects
    @aeroprojects 6 หลายเดือนก่อน

    Took only 4 minutes for WDS to build a simple yet working API with the minimal file structure 👍 man, you're always so concise and effective :) Exactly what I was looking for.

  • @OstonCodeCypher
    @OstonCodeCypher 4 ปีที่แล้ว +55

    That humble voice makes everything seem easy and indeed they were easy... Thanks for the tutorial,Stay Blessed

    • @WebDevSimplified
      @WebDevSimplified  4 ปีที่แล้ว +8

      I'm really glad I could help.

    • @jordantaylor8549
      @jordantaylor8549 4 ปีที่แล้ว +1

      Yes I agree . I feel like a lot of creators underestimate this actually

  • @ravi_m249
    @ravi_m249 3 ปีที่แล้ว

    You are awesome. I was interning and was assigned this task. I was planning to quit but then this video happened. Thanks 3000

  • @alexgochenour8740
    @alexgochenour8740 ปีที่แล้ว

    I like the explanatory style. It was simple yet abstracted enough that I watched this once and was able to immediately apply this to a Lambda function, no Express in my setup. Thank you

  • @julianaamerico3722
    @julianaamerico3722 2 ปีที่แล้ว

    I always learn so much from your videos! You're a really great teacher. Keep on keeping on! 👍

  • @anmolpansari9817
    @anmolpansari9817 2 ปีที่แล้ว

    Web Dev Simiplified has really Simplified my life! Thank You for this amazing tutorial 😊

  • @joweltisso7365
    @joweltisso7365 2 ปีที่แล้ว

    This is what I exactly need to make a paginated API in mirage js, Thank a lot. Please keep up the good work.

  • @huckbit
    @huckbit 4 ปีที่แล้ว +1

    Amazing tutorial, very clear and simple to follow. Thanks a lot!

  • @shruthibg75
    @shruthibg75 ปีที่แล้ว

    Thanks for the amazing short , crisp video. You have explained to the point.

  • @gajendra1987
    @gajendra1987 4 ปีที่แล้ว +1

    Everything here from explanation to coverage on this concept is picture perfect 👍.

  • @saarang4637
    @saarang4637 3 ปีที่แล้ว

    Great video. Helped me clearly understand the pagination in one shot. Superb!!!
    Thank you!!

  • @dnextreme
    @dnextreme 2 ปีที่แล้ว

    Loved how he explained the simple yet powerful pagination concept in Node.js! Thank you very much. +subbed

  • @brecoldyls
    @brecoldyls 4 ปีที่แล้ว +1

    Thanks so much for these videos Kyle, I really learn a lot from them 😃

  • @ajcoder2795
    @ajcoder2795 4 ปีที่แล้ว

    Kyle 😀.. You makes things easy honestly. 👍..Stay happy and blessed mate

  • @dev-suresh
    @dev-suresh 3 หลายเดือนก่อน

    Thanks for the pagination tutorial. It helped me a lot in doing my interview assignments

  • @dgua2917
    @dgua2917 4 ปีที่แล้ว +1

    After watching some of your old videos, I press "Like" first and then watch your latest videos.😎

  • @wPatrickGale
    @wPatrickGale 3 ปีที่แล้ว

    SO helpful! Thank you for putting this together.

  • @fernwood
    @fernwood ปีที่แล้ว

    The pacing of your videos is sublime.

  • @eogutier
    @eogutier 2 ปีที่แล้ว

    This is spectacularly well done and explained. Holy cow!

  • @darpananeja6755
    @darpananeja6755 2 ปีที่แล้ว

    Only one word for you mate, "Legendary!"!!

  • @vibhasvaid
    @vibhasvaid 3 ปีที่แล้ว

    Youngman you are great ! your videos are excellent and very clear.

  • @ekings2119
    @ekings2119 4 ปีที่แล้ว

    Simple and Clean, thank you so much.

  • @HamKibz
    @HamKibz 3 ปีที่แล้ว

    Thanks, man I needed this for a personal project.

  • @ogtabuada
    @ogtabuada 4 ปีที่แล้ว +8

    Thank you for this. It's frightening how you made it easy to understand something that seems so complex. :)

  • @SACHIN-gd6zy
    @SACHIN-gd6zy 4 ปีที่แล้ว

    Hands down, incredible video

  • @firojsiddiki2750
    @firojsiddiki2750 3 ปีที่แล้ว

    thank you WEB DEV SIMPLIFIED, you explained me exacltly what i wanted and how i wanted it be explained.

  • @keithvaneaton5840
    @keithvaneaton5840 4 ปีที่แล้ว +1

    This is fantastic, thank you for your very clear teaching.
    Any chance you have available or could produce a pagination tutorial explaining the process of pulling data from a public API (not from a database) and paginating those results?

  • @andresaparicio7962
    @andresaparicio7962 3 ปีที่แล้ว

    you are a great instructor man!!

  • @shivamgoyal7717
    @shivamgoyal7717 3 ปีที่แล้ว

    Thanks Man, You helped me a lottttt to understand this concept and of course in the one go, Means a lot to me, Again Thanks Have a Great Day!

  • @scottlexium
    @scottlexium 2 ปีที่แล้ว

    Bro u don't know how much I love your videos 😭 do simplified.

  • @nadaadeclarification
    @nadaadeclarification ปีที่แล้ว

    insane class, straight and killer.

  • @soufiane_krem
    @soufiane_krem 3 ปีที่แล้ว

    That was quite helpful ! Great Video

  • @surendrajadhav5565
    @surendrajadhav5565 ปีที่แล้ว

    wow .....this video helped me alot ...thanks for making this type of tutorial/video
    👍

  • @alimodz6253
    @alimodz6253 4 ปีที่แล้ว

    man I learned more than I needed thanks!

  • @claudiuciprianbetiuc3985
    @claudiuciprianbetiuc3985 4 ปีที่แล้ว

    Amazing demo! Thanks!

  • @user-jg7zo2jx2x
    @user-jg7zo2jx2x 3 ปีที่แล้ว

    thank you!! this is awesome!!! 형 덕분에 막혔던 부분 뻥 뚫렸습니다.

  • @manikandand2541
    @manikandand2541 2 ปีที่แล้ว

    thank you sir its really graet to meet u again in my journey

  • @sebdaniel4029
    @sebdaniel4029 4 ปีที่แล้ว

    You're awesome ! Thanks a lot for each video 🙇‍♂️

  • @jenniferruiz1032
    @jenniferruiz1032 2 ปีที่แล้ว

    Thank you, bro!! You are very clear teaching!

  • @RobertWildling
    @RobertWildling 4 ปีที่แล้ว +1

    Very impressiv!! Downvoters should leave a reason as to why they downvote - because I do not see any reason!

  • @nathancullen1724
    @nathancullen1724 4 ปีที่แล้ว

    Hi best tutorial I've seen for pagination! Quick question though, in your mongoose example you're finding all results inside a collection, I've got some some routes where I want to paginate every results and then I've got other routes where I'm queering the collection for specific results that I then want to paginate, how would I handle that in the middleware? Thank you

  • @MeAsMeButMe
    @MeAsMeButMe 3 ปีที่แล้ว

    Brilliant explanation, thank you!

  • @aidarousjibril6323
    @aidarousjibril6323 4 ปีที่แล้ว

    Great video kyle, always learn something from you, do you've any video about combinig different APIS in Node please ?

  • @illiamedvedev6210
    @illiamedvedev6210 4 ปีที่แล้ว

    thanks for your tutorial, you explained it all very simple and clear

  • @NaveenKumar-ue6oc
    @NaveenKumar-ue6oc 2 ปีที่แล้ว

    you saved my time,thanks

  • @BraveHearts237
    @BraveHearts237 2 ปีที่แล้ว

    Thanks this was very helpful

  • @phenomenal-hardy4438
    @phenomenal-hardy4438 2 ปีที่แล้ว

    thanks a lot, im subscribing this video really helps

  • @vaninarayan2826
    @vaninarayan2826 2 ปีที่แล้ว

    Thanks for your amazing content

  • @trickstamil7857
    @trickstamil7857 2 ปีที่แล้ว

    thank you so much......Way of explanation was awesome.......

  • @Jenna2643
    @Jenna2643 2 ปีที่แล้ว

    This is amazing! Thank you!

  • @closed482
    @closed482 3 ปีที่แล้ว

    You are awesome. The way of explanation is awesome

  • @muhammadyaqoob8000
    @muhammadyaqoob8000 3 ปีที่แล้ว

    Great Instructor.

  • @kcdiazWTV
    @kcdiazWTV 2 ปีที่แล้ว

    Awesome tutorial. Thank you.

  • @selahadinjemal7138
    @selahadinjemal7138 ปีที่แล้ว

    Awesome, thanks!

  • @fendipratama4792
    @fendipratama4792 3 ปีที่แล้ว

    you saved my life bro, thanks in advance

  • @megaplay871
    @megaplay871 2 ปีที่แล้ว

    I really love how he just make it simple

  • @MuhammadWaqas-ux1zu
    @MuhammadWaqas-ux1zu 4 ปีที่แล้ว +1

    this is amazing . you are awesome. thanks you so much. make easy for us :)

  • @jayanthit8616
    @jayanthit8616 2 ปีที่แล้ว

    Thank You its very use full and very clear.

  • @albertbarsegyan3865
    @albertbarsegyan3865 2 ปีที่แล้ว

    every time you are save me bro, thank you

  • @tijanisylla1348
    @tijanisylla1348 2 ปีที่แล้ว

    I love this guy !

  • @hectoralvarado9778
    @hectoralvarado9778 3 ปีที่แล้ว

    -you are the best! thanks

  • @BlueHat1
    @BlueHat1 5 หลายเดือนก่อน +1

    Thank you so much!

  • @GuilhermeHenrique-vo1sk
    @GuilhermeHenrique-vo1sk 3 ปีที่แล้ว

    thanks very much broww !, u did help me a lot

  • @navinyele2814
    @navinyele2814 4 ปีที่แล้ว

    This is really amazing sir.......

  • @rebarius
    @rebarius 2 ปีที่แล้ว

    Thank you so much ❤️🙌🏼

  • @thezionjohnson3590
    @thezionjohnson3590 2 ปีที่แล้ว

    2022 and this is still Fantastic!

  • @well_done_o7
    @well_done_o7 8 หลายเดือนก่อน

    Ur videos are in the most understandable way compared to others. Thanks you so much.. and i was hoping that is there any way that you create a video about pgination with Search bar.. pls 🙏

  • @williamjog93
    @williamjog93 2 ปีที่แล้ว

    Amazing, thank you!

  • @prashantsharmaofficiall
    @prashantsharmaofficiall 2 ปีที่แล้ว

    Hey Kyle, you provide us gold at worth of iron.
    You are Truly a great Developer.

  • @hoquang1386
    @hoquang1386 3 ปีที่แล้ว

    thank you very much for great content, handsome developer.

  • @jiyoungyun7494
    @jiyoungyun7494 3 ปีที่แล้ว +7

    I would like to point out that in pagination, there are 2 techniques you can use. one is LIMIT/OFFSET approach, which this video shows. An alternative is KEYSET/SEEK method. It should be noted with LIMIT/OFFSET approach, your users will see some omitted/duplicate items in your pages when someone simultaneously adds/removes some data. So if you are implementing such as infinite scroll on a many-user web-app, go for KEYSET approach instead for stable data retrieval.

    • @bhupinderbhattarai244
      @bhupinderbhattarai244 2 ปีที่แล้ว +1

      can you provide me source how to implement KEYSET approach?

  • @angrypug4387
    @angrypug4387 2 ปีที่แล้ว

    God bless you, bro!

  • @alanprogressive
    @alanprogressive 3 ปีที่แล้ว

    thanks for share! excelent explanation!!!

  • @namangarg3933
    @namangarg3933 4 ปีที่แล้ว

    Awesome explanation man!!

  • @Infinitity8
    @Infinitity8 3 ปีที่แล้ว

    Thanks a lot this really helped.
    :D

  • @dhruvhar1683
    @dhruvhar1683 3 ปีที่แล้ว

    You are awesome, Thanks a lot for this video

  • @ReinaldoTrindade
    @ReinaldoTrindade 4 ปีที่แล้ว

    This is gold!

  • @expertvinicius
    @expertvinicius ปีที่แล้ว

    Omg! It's so easy, thank you so much my friend. But, I'm gonna do that without Express, because I 'hate' Express hahaha. =)

  • @simonoldenhove9386
    @simonoldenhove9386 3 ปีที่แล้ว

    Thank you for everything.

  • @derrickberg2825
    @derrickberg2825 3 ปีที่แล้ว

    Think you could make a video on using Datatables? I'm trying to do server side processing with MongoDB with pagination. Also trying to figure out how to add buttons to each row that would change a field and a button to display a field that isn't in the table with a modal popup. Love the videos man!

  • @bizimungupascal2200
    @bizimungupascal2200 3 ปีที่แล้ว

    Fantastic!!!!!!

  • @khalidsaifullahKS
    @khalidsaifullahKS 2 ปีที่แล้ว

    that was so great

  • @thedeveloper643
    @thedeveloper643 3 ปีที่แล้ว

    this is it! thank you so muchhh

  • @-querthles-2331
    @-querthles-2331 ปีที่แล้ว

    thank you for much :)

  • @johnconnor9787
    @johnconnor9787 2 ปีที่แล้ว

    Great video

  • @sorcererstone3303
    @sorcererstone3303 4 ปีที่แล้ว +1

    Can someone explain why at 7:33, results array is being used twice "results.results = users.slice(startIndex, endIndex)"? One should be enough right? Why the code use dot to link the 2 results terms together?

  • @ameenschools
    @ameenschools 2 ปีที่แล้ว

    I always wonder why your logical thinking and solutions are concise and to the point?? do u have an explanation for that and how can a person feel that confident about programming??? what sources you use what university you attended???

  • @MinhNguyen-zx8me
    @MinhNguyen-zx8me 4 ปีที่แล้ว +1

    This is really great. Thank you very much Kyle. I have learnt a lot. However, there is a little gotcha in this solution. In the query, we still try to query for all results in a collection before doing any filters (limit and skip. Assume that you have a really big collection, thousands or millions records, this query could take time to execute. Do you know of there is any way that we address this issue ? Again, thanks Kyle !!!

  • @ChrisAthanas
    @ChrisAthanas 3 ปีที่แล้ว

    Well done

  • @usabnd
    @usabnd 3 ปีที่แล้ว

    thank you. how do you do pagination on react

  • @sushmithasn1440
    @sushmithasn1440 4 ปีที่แล้ว

    Amazing video. Can you also create a front end with a next and previous buttons?

  • @carlosvanzego6330
    @carlosvanzego6330 5 หลายเดือนก่อน

    Thanks!!💻

  • @FabioDBB
    @FabioDBB 8 หลายเดือนก่อน

    Great video!
    I've just a dubt though, Isn't putting previous/next infos in the response violating REST statelessness?

  • @soumityachauhan8609
    @soumityachauhan8609 4 ปีที่แล้ว

    😍😍 Awesome