<commit_before>'use strict';

const Post = require('../../models/Post');

const getReplies = async (req,res,next) => {

  try {
    req.replies = await Post.find({replyTo : req.params.replyTo, isRoot : false})
      .collation({locale: 'en'})
      .sort({path:'asc'});

    next();
  } catch(error) {
    next(error);
  }
};

module.exports = exports = getReplies;
<commit_msg>populate user objects on replies<commit_after>'use strict';

const Post = require('../../models/Post');

const getReplies = async (req,res,next) => {

  try {
    req.replies = await Post.find({replyTo : req.params.replyTo, isRoot : false})
      .populate('_user')
      .collation({locale: 'en'})
      .sort({path:'asc'});

    next();
  } catch(error) {
    next(error);
  }
};

module.exports = exports = getReplies;

{'fraction_non_alphanumeric': 0.19125, 'fraction_numerical': 0.0, 'mean_word_length': 3.238095238095238, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1753692', 'n_tokens_mistral': 278, 'n_tokens_neox': 278, 'n_words': 55}