<commit_before>/**
 * Created by orajiakuchukwudalu on 2017-03-15.
 */


var db = require('../config/mongodb');
var immutablePlugin = require('mongoose-immutable');

var Promise = require('bluebird');
var mongoose = require('mongoose');
mongoose.Promise = require('bluebird');

var Schema = mongoose.Schema;

var bcrypt = require('bcrypt-nodejs');

var SALT_WORK_FACTOR = 10;

/*
 TODO: Remove store following.
 TODO: Confirm all property counts are incremented and decremented
 */
var userSchema = new Schema({
    _id: {
        type: String,
        unique: true,
        default: require('shortid').generate,
        index: true,
        immutable: true
    },
    //Core information
    name:{type: String},
    username: {type: String, lowercase: true, index: true},
    middleNames:[String],
    current_location: {
        type: {
            type: String,
            default: 'Point'
        },
        coordinates: {type: [Number], default: [0,0]}
    },
    email:{type: String, index: true, unique: true,
        validate : {
            validator : function(v){
                return /^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z][a-z])|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/i.test(v);
            },
            message: '{VALUE} is not a valid email!'
        },
        immutable: true
    },
    password: {type: String},
    profilePictureUrl: {type: String},
    country: {type: String},
    projects: [{
        name: {
            type: String
        },
        description: {
            type: String
        },
        repository_url: {
            type: String
        },
        website_url: {
            type: String
        }
    }],
    website_url: {
        type: String
    },
    linkedInUrl: {type: String},
    skills: [String],
    current_job: {type: String},
    city: {type: String},<commit_msg>initial commit<commit_after>/**
 * Created by orajiakuchukwudalu on 2017-03-15.
 */


var db = require('../config/mongodb');
var immutablePlugin = require('mongoose-immutable');

var Promise = require('bluebird');
var mongoose = require('mongoose');
mongoose.Promise = require('bluebird');

var Schema = mongoose.Schema;

var bcrypt = require('bcrypt-nodejs');

var SALT_WORK_FACTOR = 10;

/*
 TODO: Remove store following.
 TODO: Confirm all property counts are incremented and decremented
 */
var userSchema = new Schema({
    _id: {
        type: String,
        unique: true,
        default: require('shortid').generate,
        index: true,
        immutable: true
    },
    //Core information
    name:{type: String},
    username: {type: String, lowercase: true, index: true},
    middleNames:[String],
    current_location: {
        type: {
            type: String,
            default: 'Point'
        },
        coordinates: {type: [Number], default: [0,0]}
    },
    email:{type: String, index: true, unique: true
    },
    password: {type: String},
    profilePictureUrl: {type: String},
    country: {type: String},
    projects: [{
        name: {
            type: String
        },
        description: {
            type: String
        },
        repository_url: {
            type: String
        },
        website_url: {
            type: String
        }
    }],
    website_url: {
        type: String
    },
    linkedInUrl: {type: String},
    skills: [String],
    current_job: {type: String},
    city: {type: String},
{'fraction_non_alphanumeric': 0.16188063063063063, 'fraction_numerical': 0.015202702702702704, 'mean_word_length': 2.268629254829807, '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': '6669302', 'n_tokens_mistral': 1170, 'n_tokens_neox': 1156, 'n_words': 258}