irish-monitor-service/scripts/datasourceProfile.js

16 lines
652 B
JavaScript

function updateDatasourceIndicators() {
var indicators = db.indicator.find();
indicators.forEach(indicator => {
indicator.indicatorPaths.forEach(path => {
if(path.chartObject && path.chartObject.includes('opendoar____::115f89503138416a242f40fb7d7f338e')) {
while(path.chartObject.includes('opendoar____::115f89503138416a242f40fb7d7f338e')) {
path.chartObject = path.chartObject.replace('opendoar____::115f89503138416a242f40fb7d7f338e', '((__index_id__))');
}
db.indicator.save(indicator);
}
});
});
}
updateDatasourceIndicators();