<commit_before>var db = require('mongoose');
var Log = require('log'), log = new Log('info');
var mr = require('./mapreduce.js'),
  models = require('./databasemodels.js');

var log = new Log('info');

var CDNURL = null;

exports.setCDNURL = function(url_) {
  CDNURL = url_;
}

/* Views */
exports.index = function(req, res, next) {
  res.render('index', { cdnurl: CDNURL });    
}

/** DB API generic */
exports.genericDBAPI = function(req, res) { 
  res.set({'Content-Type': 'application/json', 'Cache-Control' : 'no-cache,no-store,must-revalidate'});
  try {
    var query = req.query;          
    var opts = {};
    var limit = 100;
    var sort = {};
    for (q in query) {              
      try {
        if (q === 'limit') limit = parseInt(query[q]);
        else if (q === 'sort') sort = query[q];
        else {
          opts[q] = JSON.parse(query[q]);
        }<commit_msg>fix: limit raised to 5000 for genericDBAPI querys<commit_after>var db = require('mongoose');
var Log = require('log'), log = new Log('info');
var mr = require('./mapreduce.js'),
  models = require('./databasemodels.js');

var log = new Log('info');

var CDNURL = null;

exports.setCDNURL = function(url_) {
  CDNURL = url_;
}

/* Views */
exports.index = function(req, res, next) {
  res.render('index', { cdnurl: CDNURL });    
}

/** DB API generic */
exports.genericDBAPI = function(req, res) { 
  res.set({'Content-Type': 'application/json', 'Cache-Control' : 'no-cache,no-store,must-revalidate'});
  try {
    var query = req.query;          
    var opts = {};
    var limit = 5000;
    var sort = {};
    for (q in query) {              
      try {
        if (q === 'limit') limit = parseInt(query[q]);
        else if (q === 'sort') sort = query[q];
        else {
          opts[q] = JSON.parse(query[q]);
        }
{'fraction_non_alphanumeric': 0.1834710743801653, 'fraction_numerical': 0.006060606060606061, 'mean_word_length': 2.632, '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': '5293960', 'n_tokens_mistral': 627, 'n_tokens_neox': 612, 'n_words': 153}