title: Function not called post Callback
body: <p>I am using nodejs with mondodb but facing a weird situation without any errors.</p>
  
  <p>I call the updateUsers function with the callback but the updateDashboard function is not getting called at all even on successful completion of updateUsers function. The code blocks are below. There are no errors reported as well.</p>
  
  <pre><code>                updateUsers(data,dashboardDayData.key,function(err,doc){
  
                          updateDashboard(dashboardYearData,data.type,1,doc,function(err){console.log("Got executed");});
  
                  });
  
  
  function updateUsers(req,dateKey,callback){
          var yyyy        = parseInt(dateKey.toString().substring(0,4));
          var mm          = parseInt(dateKey.toString().substring(4,6));
          var dd          = dateKey.toString().substring(6,8);
          switch(req.type){
                  case Collection["begin"]:
                          Model.User.findById(req.val.did,function(err,doc){
                                  if(!err){
                                          if(doc === null || !doc){
                                                  req.type = Collection["user"];
                                                  req.val.ts = 1;
                                                  req.val.tts = 0;
                                                  event = EventFactory.getEvent(req);
                                                  event.save(function (err) {
                                                          if (err) {
                                                                  logger.error(common.getErrorMessageFrom(err));
                                                                  return;
                                                          }
                                                          var push = {};
                                                          push['_'+yyyy] = JSON.parse('{"_id":'+parseInt(mm.toString().concat(dd))+',"tse":1,"tts":0}');
                                                          Model.User.findByIdAndUpdate(req.val.did,{$push:push},{upsert:true},function(err,doc){
                                                                  console.log("err "+err);
                                                                  console.log("doc "+doc);
                                                                  if(err){
                                                                          logger.error(common.getErrorMessageFrom(err));
                                                                          return;
                                                                  }
  
                                                                                                                                  callback(err,1);
                                                          });
                                                  });
  </code></pre>
  
  <p>}</p>
  
  <pre><code>function updateDashboard(dashboardData,eventType,valueIncrement,newUserIncrement,callback){
          switch(eventType){
                  case Collection["begin"]:
                          console.log(dashboardData);
                          Model.Dashboard.findByIdAndUpdate(dashboardData,{$inc:{'val.tse':valueIncrement,'val.tnu':newUserIncrement}},{upsert:true},function(err,doc){
                                  if(err){
                                          logger.error(err);
                                  }
                          callback(err);
                          });
                          break;
  </code></pre>