text: const mongoose = require("mongoose");
  
  const Schema = mongoose.Schema;
  
  const UserSchema = new Schema({
    firstName: String,
  
    lastName: String,
  
    password: {
      type: String,
      trim: true,
      required: "Password is Required",
      validate: [({ length }) => length >= 6, "Password should be longer."]
    },
  
    email: {
      type: String,
      required: true,
      unique: true,
      lowercase: true,
      match: [/.+@.+\..+/, "Please enter a valid e-mail address"]
    },
  
    DOB: {
      type: Date
    },
  
    userCreated: {
      type: Date,
      default: Date.now
    }
  });
  
  const User = mongoose.model("User", UserSchema);
  
  module.exports = User;
  