def get_report_top_words_by_id(self, report_id, num_words):
    report = self.db['reports'].find_one({'_id': report_id}, {'words.most_popular_words': 1})
    if (len(report['words']['most_popular_words']) < num_words):
        return report['words']['most_popular_words']
    else:
        return report['words']['most_popular_words'][:(num_words - 1)]
def get_report_top_words_by_id(self, report_id, num_words):
    report = self.db['reports'].find_one({'_id': report_id}, {'words.most_popular_words': 1})
    if (len(report['words']['most_popular_words']) < num_words):
        return report['words']['most_popular_words']
    else:
        return report['words']['most_popular_words'][:(num_words - 1)]