<commit_before>exports.client = db;
exports.connect = connect;
exports.findStoresInZip = findStoresInZip;
exports.findStoresInRange = findStoresInRange;


var mongo = require('mongodb')
  , db = null
  , bson = mongo.BSONPure
  , stores = 'stores'
  ;


/**
 * Connect to snapdb mongo database.
 */
function connect(uri, callback) {
  console.log('connecting to database (' + uri + ')');
  mongo.MongoClient.connect(uri, {safe: true}, function (err, client) {
    if (err) return callback(err);

    db = client;
    db.addListener("error", function (error) {
      console.log("mongo client error: " + error);
    });
<commit_msg>added getStore to snapdb exports<commit_after>exports.client = db;
exports.connect = connect;
exports.findStoresInZip = findStoresInZip;
exports.findStoresInRange = findStoresInRange;
exports.getStore = getStore;

var mongo = require('mongodb')
  , db = null
  , bson = mongo.BSONPure
  , stores = 'stores'
  ;


/**
 * Connect to snapdb mongo database.
 */
function connect(uri, callback) {
  console.log('connecting to database (' + uri + ')');
  mongo.MongoClient.connect(uri, {safe: true}, function (err, client) {
    if (err) return callback(err);

    db = client;
    db.addListener("error", function (error) {
      console.log("mongo client error: " + error);
    });

{'fraction_non_alphanumeric': 0.1413292589763178, 'fraction_numerical': 0.0, 'mean_word_length': 3.962121212121212, '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': '5164932', 'n_tokens_mistral': 451, 'n_tokens_neox': 431, 'n_words': 102}