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

scripts.1.5.0.1-remove-event-picture.js Maven / Gradle / Ivy

The newest version!
db.events.find().forEach(
    function(event) {
        var payload = JSON.parse(event.payload);
        if (payload.definition !== undefined) {
            var definition = JSON.parse(payload.definition);
            delete payload.picture;
            delete definition.picture;

            payload.definition = JSON.stringify(definition);

            db.events.updateOne({ _id: event._id}, {$set: {payload: JSON.stringify(payload)}}, { upsert: true} );
        }
    }
);




© 2015 - 2024 Weber Informatics LLC | Privacy Policy