Skip to content

Instantly share code, notes, and snippets.

@r01010010
Created November 23, 2014 23:52
Show Gist options
  • Save r01010010/bfb4a906ae719ad80ee2 to your computer and use it in GitHub Desktop.
Save r01010010/bfb4a906ae719ad80ee2 to your computer and use it in GitHub Desktop.
for(j = 0; j < provinces.length; j++){
var province = provinces[j];
var province_name = _s.strLeft(province.provincia, '/');
mongo_provinces[j] = {
_id: new mongodb.ObjectID()
, slug: _s.slugify(province_name)
, name: province_name
, country: "spain"
, towns: []
};
var query = con.query('select * from municipios where id_provincia = ? order by nombre', [province.id_provincia], function(err, towns){ if(err) throw err;
console.log(j);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment