cosmos-migrator
Version:
Tool for running CosmosDB migrations (js scripts)
12 lines (10 loc) • 472 B
JavaScript
exports.databaseName = 'StarWars';
exports.containerName = 'jedi';
// NOTE! Create a query with a WHERE clause to limit the items to process!!!
exports.query = 'SELECT * FROM c WHERE c.title = "Master"';
exports.updateItem = function (item) {
//if possible avoid using if statements here, put the logic in the query!
item.title = 'Jedi Master';
// return the updated document! The library will replace the item in the container with this document
return item;
};