<commit_before>/**
 * Created by Nightpaws on 04/03/2016.
 */
var q = require('q');
var deferred = q.defer();
var mongoose = require('mongoose');
var config = require('../../../config');

var messages = {

    getTable: function () {
        deferred = q.defer();


        var messageModel = require('../../models/message.model');


        var query = messageModel.find().limit(20).sort({__id:-1});
        
        var promise = query.exec();
        promise.onResolve(function(err,docs) {
            if(err){
                console.log("Failed database call" + err);
            }
            else
            {
                var response = {
                  meta: docs
                };
                console.log('------DOCS------');
                console.log(docs);
                console.log('----------------');
            }
        });

        // messageModel
        //     .find().limit(20).sort({__id:-1})<commit_msg>attempting splicing of the array server side<commit_after>/**
 * Created by Nightpaws on 04/03/2016.
 */
var q = require('q');
var deferred = q.defer();
var mongoose = require('mongoose');
var config = require('../../../config');

var messages = {

    getTable: function () {
        deferred = q.defer();


        var messageModel = require('../../models/message.model');


        var query = messageModel.find().limit(20).sort({__id:-1});
        
        var promise = query.exec();
        promise.onResolve(function(err,docs) {
            if(err){
                console.log("Failed database call" + err);
            }
            else
            {
                var response = {
                  meta: docs
                };
                console.log("MESSAGE START");
                console.log("m:" + docs.message);
                console.log("s:" + docs.subject);
                console.log("u" + docs.uid);
                console.log("p" + docs.postDate);
                console.log("y" + docs.year);
                console.log("MESSAGE END");

            }
        });

        // messageModel
        //     .find().limit(20).sort({__id:-1})
{'fraction_non_alphanumeric': 0.1720226843100189, 'fraction_numerical': 0.013232514177693762, 'mean_word_length': 1.3975084937712345, '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': '2646441', 'n_tokens_mistral': 611, 'n_tokens_neox': 558, 'n_words': 114}