Our collection has around 100 million documents. We created a simple application using nodejs and expressjs with a limit clause in the mongo query . It is sufficient for the users as of now. In the mean time we are trying to implement lazy loading so that the initial page load returns few documents and when the user scrolls we would like to load further documents. Struggling where to start and how to ahead to implement it. Appreciate your suggestions. My index.js file would look like this
router.get('/users', function(req, res) {
var db = req.db;
var users = db.get('users');
users.find(query, {limit: 10000}, function(e, docs){
res.render('users', {
title: 'Users',
'users': docs
});
});
});
I would like to remove the limit and using skip trying to achieve this. Please post your suggestions