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

scripts.1.0.0.7-copy-views-to-api.js Maven / Gradle / Ivy

The newest version!
db.apis.find().forEach(
    function(api) {
        var definition = JSON.parse(api.definition);
        var views = definition.views;
        
        delete definition.views;

        db.apis.updateOne({ _id: api._id}, {$set: {views: views, definition: JSON.stringify(definition)}}, { upsert: true} );
    }
);




© 2015 - 2024 Weber Informatics LLC | Privacy Policy