<commit_before>'use strict';
const Mongoose = require('mongoose'),
      Schema = Mongoose.Schema;


const EventSchema = new Schema({
  name: String,
  noteID: String,
  type: String,
  description: String,
  location: String,
  date: Date,
  formattedDate: String,
  photos: Array
}, {
  collection: 'EventData'
});

const Event = Mongoose.model('Event', EventSchema);
module.exports = Event;<commit_msg>feat (DB): Add custom validator function to schema<commit_after>'use strict';
const Mongoose = require('mongoose'),
      Schema = Mongoose.Schema;


const EventSchema = new Schema({
  name: {
    type: String,
    validate: {
      validator: (name) => name.length >= 3,
      message: 'Your event name must be at least 3 characters long.'
    },
    required: [true, 'This event requires a name.']
  },
  noteID: String,
  type: String,
  description: String,
  location: String,
  date: Date,
  formattedDate: String,
  photos: Array,
  photoCount: Number
}, {
  collection: 'EventData'
});

const Event = Mongoose.model('Event', EventSchema);
module.exports = Event;
{'fraction_non_alphanumeric': 0.12930232558139534, 'fraction_numerical': 0.0018604651162790699, 'mean_word_length': 3.91324200913242, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2835885', 'n_tokens_mistral': 332, 'n_tokens_neox': 328, 'n_words': 102}