Skip to content

Commit

Permalink
added a script to update default field to geographicInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
temi committed Dec 17, 2024
1 parent ac6d561 commit d1eba54
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
load('../../../utils/audit.js');
var userId = "system";
db.project.find({"geographicInfo": {$exists: true},
"geographicInfo.isDefault": {$exists: false}}
).forEach(function(project) {
if (project.geographicInfo && project.geographicInfo.isDefault === undefined) {
project.geographicInfo.isDefault = false;
db.project.save(project);
audit(project, project.projectId, 'au.org.ala.ecodata.Project', userId, undefined, "Update");
print("Updated project: " + project.projectId);
}
});

0 comments on commit d1eba54

Please sign in to comment.