We're updating the issue view to help you get more done.Learn more

CT - Mix Matched tags -SBee

Support Bee- https://sunlightfoundation.supportbee.com/tickets/7529815

The tags were mapped in the admin wrong, it has been fixed. Insurance was going to Indigenous Peoples.

However, the database needs to be corrected in production also for historical data.

I ran this locally with out issues, I recommend running a back up prior to running the scripts.

//back up mongo
mongodump --db fifty states

//check the count of potentially changed records before running

db.bills.find({scraped_subjects: {$in: , $nin: }, subjects: {$in: }, state: 'ct'}).count();

//remove the 'insurance' and 'indigenous' ct bill records with a scraped insurance tag, no 'Indians' //or 'Mashantuc....' tag and a subject that contains 'Indigenous Peoples'. 'Insurance' is removed to //prevent the chance of a duplicate tag of 'Insurance'

db.bills.update({scraped_subjects: {$in: , $nin: }, subjects: {$in: }, state: 'ct'}, {$pull: {subjects: {$in: }}},

{multi: true}

);

//check the count of potentially changed records before running

db.bills.find({scraped_subjects: {$in: }, subjects: {$nin: }, state: 'ct'}).count();

//run the command to push the insurance tag into subjects

db.bills.update({scraped_subjects: {$in: }, subjects: {$nin: }, state: 'ct'}, {$push: {subjects: 'Insurance'}},

{multi: true}

);

Status

Assignee

Unassigned

Reporter

dmclamb

Priority

Normal