title: Express.js Date Validation
body: <p>I want to validate the jointdate using currentdate.<br>
  if jointdate is greater than current date I want to throw an error code.
      Using Schema level validation
  Schema:</p>
  
  <pre><code>var datevalidation=function(value){
          return value.joindate&gt;value.now+1;
      }
      var EmployeeSchema=new mongoose.Schema({
      joindate:{
          type:Date,
          validate:[datevalidation,'please enter correct date']
      }
  })
  </code></pre>