nosql - MongoDB search time and number of matching conditions
PHPz
PHPz 2017-05-17 10:04:08
0
1
1174

Similar to this, Baidu found a total of XXXXXX related results for you.
It takes XXXX milliseconds.
How is this achieved?
First calculate the number of all items and then paginate?
First, count = db.table.find().count();
Then, db.table.find().skip().limit();
Is this the case?

Also, XXX milliseconds are calculated in total or paging. . .
Solution.

PHPz
PHPz

学习是最好的投资!

reply all(1)
Peter_Zhu

It depends on the size of your data. If the amount of data is not large, you can directly send all the data to the front end for paging. The advantage is that there is no need to refresh the page to send an update request, and page turning can be achieved by directly updating the page status. However, if it is big data processing like Baidu and Google, you need to declare the parameters when sending the request, and you need to declare the starting point of the data search and the amount of data, so that turning the page is a separate data request. Mongo can directly use db.table.count() to obtain the number of a collection. As for the search time, if I were to do it, I would calculate the time from sending the request to getting the response on the front end. I can also directly calculate the time required for database search on the back end. I don’t think this function is important.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template