{"size": 598, "ext": "js", "max_stars_repo_path": "routes/members/model.js", "max_stars_repo_name": "highskillmasters/highskillmasters-api", "max_stars_repo_stars_event_min_datetime": "2020-07-25T00:46:38.000Z", "max_stars_repo_stars_event_max_datetime": "2020-08-07T10:03:35.000Z", "max_issues_repo_path": "routes/members/model.js", "max_issues_repo_name": "highskillmasters/highskillmasters-api", "max_issues_repo_issues_event_min_datetime": "2020-07-25T00:40:31.000Z", "max_issues_repo_issues_event_max_datetime": "2020-08-01T15:43:53.000Z", "max_forks_repo_path": "routes/members/model.js", "max_forks_repo_name": "highskillmasters/highskillmasters-api", "max_forks_repo_forks_event_min_datetime": "2020-07-25T01:27:39.000Z", "max_forks_repo_forks_event_max_datetime": "2020-07-25T01:27:39.000Z"}
{"max_stars_count": 40, "max_issues_count": 13, "max_forks_count": 1, "avg_line_length": 18.6875, "max_line_length": 60, "alphanum_fraction": 0.627090301}
const mongoose = require('mongoose')
const AutoIncrement = require('mongoose-sequence')(mongoose)
const Schema = mongoose.Schema

const MemberSchema = Schema(
  {
    email: {
      type: String,
      index: true,
      unique: true,
      required: [true, 'Email is required'],
      min: [2, 'Email is too short'],
    },
    isVerified: {
      type: Boolean,
      default: false,
    },
  },
  {
    timestamps: true,
  }
)

MemberSchema.plugin(AutoIncrement, {
  id: 'members_id_counter',
  inc_field: 'id',
})

const Member = mongoose.model('Member', MemberSchema)

module.exports = Member
