for first block of code , console.log("ff : "+ff) prints exactly like this :
ff : { _id : sd845y3hishofiuwhei , fullname : 'sachin' }
console.log("ff JSON : "+JSON.stringify(ff)); // this line prints like below :
ff JSON : [{"_id":"sd845y3hishofiuwhei" , "fullname" : "sachin" }]
how can i get that "sachin" separately in a separate variable ?
var fullname=SampleModel.find({uname:req.session.uname},{fullname : true},function(err,ff){
if(!err){
console.log("ff : "+ff);
console.log("ff JSON : "+JSON.stringify(ff));
return ff;
}else {
return null;
}
});
the below block of code is giving error like "invalid object id " . what can be the problem ?
var ret= AnotherModel.find({_id : { $nin : ["1","2"] } }, function(err,details){
if(!err) {
res.send(details);
}
else {
console.log("Error : "+err);
res.send(err);
}
});
i am implementing textarea like this
<textarea id="myarea" cols="100" rows="20" ></textarea>
output box is changing its height when i change rows , but that cols , when i change "cols" , its width not changing . the output box also has small width , i check in both chrome and mozilla. Whats the solution ? Thanks