<commit_before>function(doc, req) {
	// only allow putting new text, not updating old text
	if (doc) return [null, {
		code: 409,
		body: "conflict"
	}];

	var text = req.body;
	var doc = {
		_id: (new Date()/1000).toString(),
		text: text
	};
	return [doc, "ok"];
}<commit_msg>Allow updating old text with _update/add_text<commit_after>function(doc, req) {
	if (!doc) doc = {
		_id: req.id || (new Date()/1000).toString()
	};
	doc.text = req.body;
	return [doc, "ok"];
}
{'fraction_non_alphanumeric': 0.18259023354564755, 'fraction_numerical': 0.02335456475583864, 'mean_word_length': 3.7676767676767677, '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': '5768545', 'n_tokens_mistral': 197, 'n_tokens_neox': 180, 'n_words': 51}