<commit_before>// require needed modules
var mongoose = require('mongoose'),
  User = require('./users'),
  Schema = mongoose.Schema;

// create a schema
var DocumentSchema = new Schema({
  ownerId: {
    type: Schema.Types.ObjectId,
    ref: 'User'
  },
  title: {
    type: String
  },
  content: {
    type: String
  },
  dateCreated: {
    type: Date,
    default: Date.now()
  },
  lastModified: {
    type: Date,
    default: Date.now()
  }
});<commit_msg>Refactors document model<commit_after>// require needed modules
var mongoose = require('mongoose'),
  User = require('./users'),
  Schema = mongoose.Schema;

// create a schema
var DocumentSchema = new Schema({
  ownerId: {
    type: Schema.Types.ObjectId,
    ref: 'User'
  },
  title: {
    type: String,
    unique: true
  },
  content: {
    type: String
  },
  dateCreated: {
    type: Date,
    default: Date.now()
  },
  lastModified: {
    type: Date,
    default: Date.now()
  }
});
{'fraction_non_alphanumeric': 0.14900314795383002, 'fraction_numerical': 0.0, 'mean_word_length': 2.7707509881422925, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4792968', 'n_tokens_mistral': 319, 'n_tokens_neox': 323, 'n_words': 82}