<commit_before>#
# <NAME> 
#

mongodb = require 'mongodb'
#MongoDB kobling
#server  = new mongodb.Server "127.0.0.1", 27017, {safe:true, auto_reconnect: true}, {}
#db      = new mongodb.Db 'ntb', server, {safe:true}
#db.open(()->)

replSet = new mongodb.ReplSet( [
  new mongodb.Server( '127.0.0.1', 27017, {}),
  new mongodb.Server( '127.0.0.1', 27018, {}),
  new mongodb.Server( '127.0.0.1', 27019, {})
  ]
)

db = new mongodb.Db('ntb_03', replSet, {native_parser: true});
console.log "Kobler seg til mongodb replica set ntb og database ntb_<versjon>"
db.open(()->)

exports.get = (req, res) ->
  db.collection req.params.object, (err, collection) -><commit_msg>Removes uneeded ";" at end of line<commit_after>#
# <NAME> 
#

mongodb = require 'mongodb'
#MongoDB kobling
#server  = new mongodb.Server "127.0.0.1", 27017, {safe:true, auto_reconnect: true}, {}
#db      = new mongodb.Db 'ntb', server, {safe:true}
#db.open(()->)

replSet = new mongodb.ReplSet( [
  new mongodb.Server( '127.0.0.1', 27017, {}),
  new mongodb.Server( '127.0.0.1', 27018, {}),
  new mongodb.Server( '127.0.0.1', 27019, {})
  ]
)

db = new mongodb.Db('ntb_03', replSet, {native_parser: true})
console.log "Kobler seg til mongodb replica set ntb og database ntb_<versjon>"
db.open(()->)

exports.get = (req, res) ->
  db.collection req.params.object, (err, collection) ->
{'fraction_non_alphanumeric': 0.19732937685459942, 'fraction_numerical': 0.06824925816023739, 'mean_word_length': 4.090566037735849, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 8, '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': '2091156', 'n_tokens_mistral': 623, 'n_tokens_neox': 551, 'n_words': 129}