<commit_before>var path = require('path');

var app = require(path.resolve(__dirname, '../server/server'));
var ds = app.datasources.mongovotebdtest;
var oldds = app.datasources.votebdold;


oldds.discoverAndBuildModels('election_list', {schema: 'votebd_july2015'},
  function(err, models) {
    if (err) throw err;

    models.ElectionList.find(function(err, elections) {
      if (err) throw err;

      console.log('Found:', elections);


      var count = elections.length;
      elections.forEach(function(election) {
        app.models.Donor.create(election, function(err, model) {
          if (err) throw err;

          console.log('Created:', model);

          count--;
          if (count === 0)
            ds.disconnect();
        });
      });



      oldds.disconnect();
    });
  });



//ds.automigrate('Donor', function(err) {
//  if (err) throw err;
//
//  var elections = [
//    {
//      name: 'kamela'
//    },
//    {
//      name: 'tamela'
//    },
//    {
//      name: 'pamela'
//    }<commit_msg>fetching data from mysql and put at mongodb<commit_after>var path = require('path');

var app = require(path.resolve(__dirname, '../server/server'));
var ds = app.datasources.mongovotebdtest;
var oldds = app.datasources.votebdold;


oldds.discoverAndBuildModels('election_list', {schema: 'votebd_july2015'},
  function(err, models) {
    if (err) throw err;

    models.ElectionList.find(function(err, elections) {
      if (err) throw err;

      console.log('Found:', elections);


      var count = elections.length;
      elections.forEach(function(election) {
        app.models.ElectionList.create(election, function(err, model) {
          if (err) throw err;

          console.log('Created:', model);

          count--;
          if (count === 0)
            ds.disconnect();
        });
      });



      oldds.disconnect();
    });
  });



//ds.automigrate('Donor', function(err) {
//  if (err) throw err;
//
//  var elections = [
//    {
//      name: 'kamela'
//    },
//    {
//      name: 'tamela'
//    },
//    {
//      name: 'pamela'
//    }
{'fraction_non_alphanumeric': 0.1713738630923887, 'fraction_numerical': 0.004786979415988511, 'mean_word_length': 2.2554517133956384, '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': '5172010', 'n_tokens_mistral': 722, 'n_tokens_neox': 675, 'n_words': 133}