in my code res.render is not loading a complete file instead it only shows a first page of the file
PersonalInfo.findOne({ name:'amna'}, function(err,post){
if(err || !posts)
{
console.log("find is not done");
}
else{
console.log(post);
res.render("/profilearea.ejs");
})
The second parameter to the callback of findOne
isn't an array, it's just a single model instance (or null
). Did you mean to to use find
instead?