<commit_before>'use strict';

var mongojs = require('mongojs')
  , config = require('../config')
  , db = mongojs(config.DB)
  , journals = db.collection('journals')
  ;

function getJournals(request, reply){
  journals.find(request.query, function (err, data) {
    if(err){
      reply(err);
    } else {
      reply(data)
    }
  });
}

function getJournal(request, reply){
  journals.findOne({sakId:request.params.sakId}, function (err, data) {
    if(err){
      reply(err)
    } else {
      reply(data);
    }
  });
}


module.exports.getJournals = getJournals;

module.exports.getJournal = getJournal;<commit_msg>Adds getJournalByDate<commit_after>'use strict';

var mongojs = require('mongojs')
  , config = require('../config')
  , db = mongojs(config.DB)
  , journals = db.collection('journals')
  ;

function getJournals(request, reply){
  journals.find(request.query, function (err, data) {
    if(err){
      reply(err);
    } else {
      reply(data)
    }
  });
}

function getJournalsByDate(request, reply){
  var journalDate = parseInt(request.params.date, 10)
    ;
  journals.find({"JOURNPOST_OJ.JP_JDATO":journalDate}, function (err, data) {
    if(err){
      reply(err);
    } else {
      reply(data)
    }
  });
}

function getJournal(request, reply){
  journals.findOne({sakId:request.params.sakId}, function (err, data) {
    if(err){
      reply(err)
    } else {
      reply(data);
    }
  });
}

module.exports.getJournals = getJournals;

module.exports.getJournal = getJournal;
{'fraction_non_alphanumeric': 0.15716180371352786, 'fraction_numerical': 0.001326259946949602, 'mean_word_length': 3.3487031700288186, 'pattern_counts': {'":': 1, '<': 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': '7017201', 'n_tokens_mistral': 545, 'n_tokens_neox': 532, 'n_words': 89}