<commit_before>'use strict';

/**
 * Module dependencies.
 */
var mongoose = require('mongoose'),
	Skill = mongoose.model('Skill'),
	_ = require('lodash');

/**
 * Get the error message from error object
 */
var getErrorMessage = function(err) {
	var message = '';

	if (err.code) {
		switch (err.code) {
			case 11000:
			case 11001:
				message = 'Skill already exists';
				break;
			default:
				message = 'Something went wrong';
		}
	} else {
		for (var errName in err.errors) {
			if (err.errors[errName].message) message = err.errors[errName].message;
		}
	}

	return message;
};

/**
 * Create a Skill
 */
exports.create = function(req, res) {<commit_msg>Add NEO4J query in comment<commit_after>'use strict';

/**
 * Module dependencies.
 */
var mongoose = require('mongoose'),
	Skill = mongoose.model('Skill'),
	_ = require('lodash');


// queryAll
//MATCH (n: XEBIAN ) RETURN n

//findByEmail
//'MATCH (n: XEBIAN ) WHERE n.email='+ email + ' RETURN n'

//find Skill by name
//'MATCH (n: SKILL ) WHERE n.name=' + skillName + ' RETURN n'


/**
 * Get the error message from error object
 */
var getErrorMessage = function(err) {
	var message = '';

	if (err.code) {
		switch (err.code) {
			case 11000:
			case 11001:
				message = 'Skill already exists';
				break;
			default:
				message = 'Something went wrong';
		}
	} else {
		for (var errName in err.errors) {
			if (err.errors[errName].message) message = err.errors[errName].message;
		}
	}

	return message;
};

/**
 * Create a Skill
 */
exports.create = function(req, res) {
{'fraction_non_alphanumeric': 0.1562905317769131, 'fraction_numerical': 0.013618677042801557, 'mean_word_length': 3.192934782608696, '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': '4141923', 'n_tokens_mistral': 603, 'n_tokens_neox': 539, 'n_words': 147}