text: const mongoose = require('mongoose')
  const Schema = mongoose.Schema
  
  const validator = require('validator')
  
  var UserSchema = new Schema({
    email: {
      type: String,
      required: true,
      trim: true,
      minlength: 1,
      unique: true,
      validate: {
        validator: validator.isEmail,
        message: '{VALUE} is not a valid email'
      }
    },
    password: {
      type: String,
      require: true,
      minlength: 6
    },
    tokens: [{
      access: {
        type: String,
        required: true
      },
      token: {
        type: String,
        required: true
      }
    }]
  })
  
  var User = mongoose.model('User', UserSchema)
  module.exports = {User}