<commit_before>var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var Goal = new Schema({
    name: String,
    desc: String,
    completed: {type:Boolean, default: false},
    assigned: { 
		type: mongoose.Schema.Types.ObjectId, 
		ref: 'Roel'}
    creator: { 
		type: mongoose.Schema.Types.ObjectId, 
		ref: 'User'},
    created_at: Date,
    updated_at: Date
});
//on every save, add the date
Goal.pre('save', function(next){
	//get the current date
	var currentDate = new Date();
	//change the udpated_at field to current date
	this.updated_at = currentDate;

	//if created_at doesn't exist, add to the field
	if(!this.created_at)
		this.created_at = currentDate;

	next();
});
module.exports = mongoose.model('Goal', Goal);<commit_msg>edite goal schema, add routes, and add helper functions<commit_after>var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var Goal = new Schema({
    name: String,
    desc: String,
    completed: {type:Boolean, default: false},
    assigned: String,
    creator: { 
		type: mongoose.Schema.Types.ObjectId, 
		ref: 'User'},
    created_at: Date,
    updated_at: Date
});
//on every save, add the date
Goal.pre('save', function(next){
	//get the current date
	var currentDate = new Date();
	//change the udpated_at field to current date
	this.updated_at = currentDate;

	//if created_at doesn't exist, add to the field
	if(!this.created_at)
		this.created_at = currentDate;

	next();
});
module.exports = mongoose.model('Goal', Goal);
{'fraction_non_alphanumeric': 0.13257828114590273, 'fraction_numerical': 0.0, 'mean_word_length': 3.9407894736842106, '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': '6231498', 'n_tokens_mistral': 509, 'n_tokens_neox': 503, 'n_words': 148}