<commit_before>// Publish list of topics (sorted by date) and top comment for each

Meteor.publishComposite('topicsList', function (limit) {
  check(limit, Match.Integer);

  return {
    find: function () {
      return Topics.find({}, { sort: { 'score': -1, 'createdAt': -1 }, limit: limit });
    },
    children: [{
      find: function (topic) { // top comment for each topic
        return Comments.find({ 'topicId': topic._id, 'isDeleted': false }, {
          sort: { 'upvotes': -1 },
          limit: 1
        });
      },
      children: [{<commit_msg>Limit fields for topic list<commit_after>// Publish list of topics (sorted by date) and top comment for each

Meteor.publishComposite('topicsList', function (limit) {
  check(limit, Match.Integer);

  return {
    find: function () {
      var fields = {
        'title': 1,
        'userId': 1,
        'createdAt': 1,
        'commentsCount': 1,
        'pro': 1,
        'con': 1,
        'score': 1
      };

      return Topics.find({}, { fields: fields, sort: { 'score': -1, 'createdAt': -1 }, limit: limit });
    },
    children: [{
      find: function (topic) { // top comment for each topic
        return Comments.find({ 'topicId': topic._id, 'isDeleted': false }, {
          sort: { 'upvotes': -1 },
          limit: 1
        });
      },
      children: [{
{'fraction_non_alphanumeric': 0.15955056179775282, 'fraction_numerical': 0.011235955056179775, 'mean_word_length': 2.234866828087167, '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': '5144924', 'n_tokens_mistral': 416, 'n_tokens_neox': 406, 'n_words': 124}