<commit_before>Meteor.publish('notes', function (text) {
    return Notes.find({
        $or: [
            {text: { $regex: text }}
        ]
    });
});

Notes.allow({
    insert: function(userId, doc){
        return true;
    },
    update:  function(userId, doc, fieldNames, modifier){
        return false;
    },
    remove:  function(userId, doc){
        return true;
    }
});

Notes.deny({
    insert: function (userId, doc) {
        return (typeof doc.text === 'undefined' || doc.text.length < 3);
    }
});<commit_msg>Update notes-validation<commit_after>Meteor.publish('notes', function (text) {
    return Notes.find({
        $or: [
            {text: { $regex: text }}
        ]
    });
});

Notes.allow({
    insert: function(userId, doc){
        return true;
    },
    update:  function(userId, doc, fieldNames, modifier){
        return false;
    },
    remove:  function(userId, doc){
        return true;
    }
});

Notes.deny({
    insert: function (userId, doc) {
        return (
            typeof doc.text === 'undefined'
            || doc.text.length < 3
            || !(doc.date instanceof Date)
        );
    }
});
{'fraction_non_alphanumeric': 0.158992180712424, 'fraction_numerical': 0.0017376194613379669, 'mean_word_length': 2.0, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1626194', 'n_tokens_mistral': 360, 'n_tokens_neox': 358, 'n_words': 80}