Y
Y
YakutD2020-08-27 17:43:50
Node.js
YakutD, 2020-08-27 17:43:50

What is the best way to load data?

Hello, I can’t find the best solution to the following problem:
in componentDidMount I get a list of records via ajax, and display them in 2 pieces (there will be 100 on the prod, now there are just few test records, it’s so convenient for me). After the output, I show the "Load more" button, by clicking on which the following records are loaded. Back on node js, mongodb base, I limit the selection like this:

{$skip: (pageNumber > 0) ? ((pageNumber - 1) * nPerPage) : 0}, //pageNumber- номер страницы, nPerPage- лимит
                {$limit: nPerPage}


But this approach is bad in that records can be deleted and new ones added, but I get it, I can’t track it in any way. How to do it right?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question