As Mongoose doesn't have an option for random find, which of the following is better to use? (less resource consuming)
Minimal query and then big query:
Page.find()
.select('_id')
.then(function(pages){
var randomPage = _.sample(pages);
Page.findOne({id: randomPage._id})
.populate('comments')
.then(function(page){...}
}
One query and picking a random item:
Page.find()
.populate('comments')
.then(function(pages){
var randomPage = _.sample(pages);
...
}