<commit_before>var mongoose = require('mongoose');
var ObjectId = mongoose.Schema.Types.ObjectId;

var GameSchema = mongoose.Schema({
	descs  : {type: [String], required: true},
	levels : {type: [String], required: true},
	name   : {type: String, required: true, unique : true},
})

GameSchema.statics.add_game = function (game_name, descs, levels, callback) {
	var descs = descs || [''];
	var levels = levels || [''];
	this.create({
		name: game_name, 
	 	descs: descs, 
		levels: levels
	}, callback)
}

GameSchema.statics.update_game = function (game_name, descs, levels, callback) {
	console.log(descs[0]);
	this.update({name: game_name}, {
		levels: levels,
		descs: descs
	}, callback)
}

GameSchema.statics.delete_game = function (game_name, callback) {
	this.remove({name: game_name}, (err) => {
		if (err) {
			console.log(err);
		}
	}, callback)
}

GameSchema.statics.delete_level = function (game_name, level_num, callback) {
	this.findOne({}, game_name, (err, game) => {
		if (game) {
			game.levels.splice(level_num, 1);<commit_msg>got rid of stray print<commit_after>var mongoose = require('mongoose');
var ObjectId = mongoose.Schema.Types.ObjectId;

var GameSchema = mongoose.Schema({
	descs  : {type: [String], required: true},
	levels : {type: [String], required: true},
	name   : {type: String, required: true, unique : true},
})

GameSchema.statics.add_game = function (game_name, descs, levels, callback) {
	var descs = descs || [''];
	var levels = levels || [''];
	this.create({
		name: game_name, 
	 	descs: descs, 
		levels: levels
	}, callback)
}

GameSchema.statics.update_game = function (game_name, descs, levels, callback) {
	this.update({name: game_name}, {
		levels: levels,
		descs: descs
	}, callback)
}

GameSchema.statics.delete_game = function (game_name, callback) {
	this.remove({name: game_name}, (err) => {
		if (err) {
			console.log(err);
		}
	}, callback)
}

GameSchema.statics.delete_level = function (game_name, level_num, callback) {
	this.findOne({}, game_name, (err, game) => {
		if (game) {
			game.levels.splice(level_num, 1);
{'fraction_non_alphanumeric': 0.16289156626506024, 'fraction_numerical': 0.0014457831325301205, 'mean_word_length': 4.580645161290323, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '6922579', 'n_tokens_mistral': 779, 'n_tokens_neox': 751, 'n_words': 170}