Skip to content

Instantly share code, notes, and snippets.

@ealsur
Created February 6, 2018 00:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ealsur/b0c0d03a98ed4ab3715b01f6a1d4e03c to your computer and use it in GitHub Desktop.
Save ealsur/b0c0d03a98ed4ab3715b01f6a1d4e03c to your computer and use it in GitHub Desktop.
Azure Cosmos DB + Functions Cookbook - live migration index.js
module.exports = function(context, input) {
if(!!input && input.length > 0){
context.bindings.docsToSave = [];
for(let i = 0, len=input.length; i<len;i++){
const doc = input[i];
// Do something here with the doc or create a new one
context.bindings.docsToSave.push(doc);
}
}
context.done();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment