Answer the question
In order to leave comments, you need to log in
How to load articles in Node JS?
There are 12-18 articles, clicking on one of them opens detailed information. When content is loaded, only 6 are displayed. Question:
How can I make sure that when the user clicks on the "Load more" button, 6 articles are loaded from the database?
Answer the question
In order to leave comments, you need to log in
There are different ways - it depends on how you did it. This is called pagination, there are different ways to do this in general and in mongo in particular, and it is well described in many places.
For example, you can use skip and when you click "download more", set it to 6, 12, 18, and so on.
Or take something like https://github.com/edwardhotchkiss/mongoose-paginate if you don't want to invent your own.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question