function addToServer(myid) {
console.log("jayesh"+db.server.find({id:myid})+"\n");
return db.server.find({id:myid});
};
addToServer(myid,function(resp) {
console.log("something");
if(resp.count()>0)
console.log("present");
else
console.log("Nope");
});
I want to know whether document with id = myid is present in server collection. I guess there is some issue with callback but being a novice don't have much a knowledge about it. Please help me out.Thanks
P.S For function I am getting output saying "jayesh[object Object] " and nothing is printing for callback method.