There are two kinds of paging:
- Via limit and skip , just like @milan proposed.
- Via range query:
Via range query:
db.items.find({created: {$gt: startDate, $lt: endDate})
db.items.find({created: {$gt: startDate, $lt: endDate})
Range queries will work faster then skip, because they are no need to move towards 'skip' item.
Look into related thread as well.
For your case if you have only next/prev buttons range paging should be good option.
There are two kinds of paging:
db.items.find({created: {$gt: startDate, $lt: endDate})
Range queries will work faster then skip, because they are no need to move towards 'skip' item.
Look into related thread as well.
For your case if you have only next/prev buttons range paging should be good option.
There are two kinds of paging:
Via range query:
db.items.find({created: {$gt: startDate, $lt: endDate})
Range queries will work faster then skip, because they are no need to move towards 'skip' item.
Look into related thread as well.
For your case if you have only next/prev buttons range paging should be good option.
There are two kinds of paging:
db.items.find({created: {$gt: startDate, $lt: endDate})
Range queries will work faster then skip, because they are no need to move towards 'skip' item.
Look into related thread thread as well.
For your case if you have only next/prev buttons range paging should be good option.
There are two kinds of paging:
db.items.find({created: {$gt: startDate, $lt: endDate})
Range queries will work faster then skip, because they are no need to move towards 'skip' item.
Look into related thread as well.
For your case if you have only next/prev buttons range paging should be good option.
There are two kinds of paging:
db.items.find({created: {$gt: startDate, $lt: endDate})
Range queries will work faster then skip, because they are no need to move towards 'skip' item.
Look into related thread as well.
For your case if you have only next/prev buttons range paging should be good option.
There are two kinds of paging:
db.items.find({created: {$gt: startDate, $lt: endDate})
Range queries will work faster then skip, because they are no need to move towards 'skip' item.
Look into related thread as well.
For your case if you have only next/prev buttons range paging should be good option.