How to use Anchor, the validation system of sails?

I'm trying to use Sails, but I can't use the model validation, can anyone help me?

Validations are added to the attributes object on a model. You can find a list of available validations at: Sails Wiki - Models. They are run whenever you are submitting data to be written to a datastore. So on create Waterline will validate all the attributes you submit and on update it will validate the attributes you are trying to change.

An Example model with validations would look something like:

module.exports = {

  attributes: {

    firstName: {
      type: 'string',
      minLength: 3,
      required: true
    },

    lastName: {
      type: 'string',
      minLength: 3,
      required: true
    },

    email: {
      // types can be a validation type and will be converted to a string
      // when saved
      type: 'email',
      required: true
    },

    sex: {
      type: 'string',
      in: ['male', 'female']
    },

    favoriteColor: {
      type: 'string',
      defaultsTo: 'blue'
    },

    age: {
      type: 'integer',
      min: 18
    }

  }
}