title: RangeError: Invalid status code: undefined [Node + mongoDB]
body: <p>I get that error when trying to use a method that I defined in my schema. The error happens when I make a <em>POST</em> request. </p>
  
  <p>This is the static method I have in the Schema:</p>
  
  <pre><code>usuarioSchema.static.checkIfUserExists = function(email,cb){
      const query = Usuario.findOne({email});
      return query.exec(cb);
  }
  </code></pre>
  
  <p>I call it from my router like this: </p>
  
  <pre><code>Usuario.checkIfUserExists(email, (err, exists)=&gt;{
              if(err){ 
                  next(err);            
              }
              if(exists){
                  res.json(new CustomError('DuplicatedEmail','Ya existe un usuario registrado con ese email',res));
                  return;
              }
  }
  </code></pre>
  
  <p>I have tryied to use the debugger but it doesn't enter the function. And with console log what is before the call executes but from inside de schema static function can't log anything. </p>
  
  <p>With <strong>try-catch</strong> it gives me the error that <strong>checkIfUserExists</strong> <em>is not a function</em></p>