All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scripts.3.9.0.2-events-migration.js Maven / Gradle / Ivy

The newest version!
print('Migrate events to reference multiple environments');
// Override this variable if you use prefix
const prefix = '';

const events = db.getCollection(`${prefix}events`);

events.find({environments: {$exists: false}}).forEach((event) => {
        event.environments = [event.environmentId];
        delete event.environmentId;
        events.replaceOne({ _id: event._id }, event);
    }
);




© 2015 - 2024 Weber Informatics LLC | Privacy Policy