<commit_before>Meteor.publish('all-posts', function () {
    return Posts.find();
});

Meteor.publish('limited-posts', function () {
    return Posts.find({}, {
        limit: 2,
        sort: {timeCreated:  -1}
    });
});

Meteor.publish('specificfields-posts', function () {
    return Posts.find({}, {
        fields: {
            title: 1
        }
    });
});

Meteor.publish('lazyload-posts', function (limit) {
    return Posts.find({}, {
        limit: limit,
        fields: {
            text: 0
        },
        sort: {timeCreated: -1}
    });
});

Meteor.publish('single-post', function (slug) {
    return Posts.find({slug: slug});
});<commit_msg>User roles publication.<commit_after>Meteor.publish('all-posts', function () {
    return Posts.find();
});

Meteor.publish('limited-posts', function () {
    return Posts.find({}, {
        limit: 2,
        sort: {timeCreated:  -1}
    });
});

Meteor.publish('specificfields-posts', function () {
    return Posts.find({}, {
        fields: {
            title: 1
        }
    });
});

Meteor.publish('lazyload-posts', function (limit) {
    return Posts.find({}, {
        limit: limit,
        fields: {
            text: 0
        },
        sort: {timeCreated: -1}
    });
});

Meteor.publish('single-post', function (slug) {
    return Posts.find({slug: slug});
});

Meteor.publish("userRoles", function () {
    if (this.userId) {
        return Meteor.users.find(this.userId, {fields: {roles: 1}});
    } else {
        this.ready();
    }
});
{'fraction_non_alphanumeric': 0.18708827404479578, 'fraction_numerical': 0.007246376811594203, 'mean_word_length': 2.2807775377969763, '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': '1742230', 'n_tokens_mistral': 513, 'n_tokens_neox': 489, 'n_words': 91}