<commit_before>'use strict';

const MongoClient = require('mongodb');
const assert = require('assert');
const utils = require('./utils');
const { MONGODB } = require('./config');

const mongodb = MONGODB;

// let categories = ['Entertainment: Music', 'General Knowledge'];

const findDocuments = (db, callback) => {
  const collection = db.collection('questions');
  // const randomC = collection.count()
  // const rand = Math.floor( Math.random() * randomC );
  let categoriesList = utils.getRandomCategories();
  console.log("this is list of cat", categoriesList)
  collection.find({category: { $in: categoriesList}}).toArray((err, questions) => {
    assert.equal(err, null);
    callback(questions, categoriesList);
  });
};

const jeopardy = MongoClient.connection;

module.exports = jeopardy;

module.exports = {
  findQuestion: (callback) => {
    MongoClient.connect(mongodb, (err, db) => {
      assert.equal(null, err);<commit_msg>(fix) mongo.config for production<commit_after>'use strict';

const MongoClient = require('mongodb');
const assert = require('assert');
const utils = require('./utils');

const MONGODB  = require('./config') || process.env.MONGODB_URI;

const mongodb = MONGODB;

// let categories = ['Entertainment: Music', 'General Knowledge'];

const findDocuments = (db, callback) => {
  const collection = db.collection('questions');
  // const randomC = collection.count()
  // const rand = Math.floor( Math.random() * randomC );
  let categoriesList = utils.getRandomCategories();
  console.log("this is list of cat", categoriesList)
  collection.find({category: { $in: categoriesList}}).toArray((err, questions) => {
    assert.equal(err, null);
    callback(questions, categoriesList);
  });
};

const jeopardy = MongoClient.connection;

module.exports = jeopardy;

module.exports = {
  findQuestion: (callback) => {
    MongoClient.connect(mongodb, (err, db) => {
      assert.equal(null, err);
{'fraction_non_alphanumeric': 0.1612234318299637, 'fraction_numerical': 0.0, 'mean_word_length': 4.6932153392330385, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '2203779', 'n_tokens_mistral': 592, 'n_tokens_neox': 563, 'n_words': 139}