Skip to content

Commit

Permalink
Merge pull request #3394 from AtlasOfLivingAustralia/feature/issue3393
Browse files Browse the repository at this point in the history
added a script to update default field to geographicInfo
  • Loading branch information
chrisala authored Dec 17, 2024
2 parents ac6d561 + d1eba54 commit 95ccc8a
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 95ccc8a

Please sign in to comment.