ProjectModel.find({projectName: 'name'}).sort({viewCount: -1}).limit(5).exec(
function(err, projects) {
...
}
);
Just trying to learn whats this query is doing. i believe it is searching for viewCount in a descending order and the result is limited to 5.
1 Answer