I want to limit the length of data returned by Model.find() in mongodb/mongoose
here is my code Want to return 'Excerpt' from content.
Blog.find({},{
title: 1,
content: 1 // basically wants to return content not more than 200 character
}, function(err, data){
if (err) {
console.log(err);
}
res.render('blog/posts', {
title:'All posts',
posts: data
});
});
In other words how to return limited content from mongoDB
Update Found solution: