title: Variable id not defined outside moongoose function NODE JS
body: <p>i want to assing two diferent values to the same variable depends the result of the moongose query but im gettin this error </p>
  
  <pre><code>events.js:187
        throw er; // Unhandled 'error' event
        ^
  
  ReferenceError: barberInfo is not defined
  </code></pre>
  
  <p>this is my code in node js </p>
  
  <pre><code>barber.findOne({id:idBarber},function(err,response){
          if(response){
            //if barber exists in the database 
            barberInfo =response.toJSON();
          }else{
            //if no exists in the database
            barberInfo={
              id:0,
              stairs:0.0,
              numberServices:0,
              urlImg: "https://i.pinimg.com/736x/a4/93/25/a493253f2b9b3be6ef48886bbf92af58.jpg",
              name: "Sin",
              lastName : "Asignar",
              phone : "000-000-0000"
            }
          }
        });
  console.log(barberInfo);
  
  </code></pre>
  
  <p>I defined the variable in the two cases, how can i define it ? </p>