Skip to content

Commit

Permalink
#2670 script to delete unused age range data
Browse files Browse the repository at this point in the history
  • Loading branch information
iamleeg committed May 23, 2022
1 parent cc11650 commit f864626
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* This script deletes the externally-specified age range information from any case that has it,
* so that the only information about the age for a case is the bucketed age ranges.
* Run this after ../migrations/20220506100633-remove-age-range.js to remove the (now unused,
* and unexpected for validation) stale data.
*/

print(new Date() + "Deleting old age ranges");
db.cases.updateMany({ 'demographics.ageRange': { $exists: true }}, { $unset: { 'demographics.ageRange': 0 }});
print(new Date() + "Done");

0 comments on commit f864626

Please sign in to comment.