mongodbLike other databases, you can query the corresponding number of data for paging operations. The official documents also have corresponding instructions, such as mongodb.limit and mongodb.skip. Or you can refer to this Chinese description limit.skip. Hope it helps you
The conventional method is:
There is also a way with better performance:
mongodb
Like other databases, you can query the corresponding number of data for paging operations. The official documents also have corresponding instructions, such as mongodb.limit and mongodb.skip. Or you can refer to this Chinese description limit.skip. Hope it helps youxxxx.find({'xxx':'xxx'},function(err,rs){
}).limit(listnum).sort({'id':-1}).skip((pagenum-1)*listnum);
//listnum is the number of records on a page and pagenum is the page number