Skip to content

Instantly share code, notes, and snippets.

@ealsur ealsur/index.js
Created Jan 30, 2018

Embed
What would you like to do?
Azure Cosmos DB + Functions Cookbook - output collector index.js
module.exports = function (context, req) {
context.log('Detected ' + req.body.length + ' incoming documents');
context.bindings.documentsToStore = [];
for(let i = 0, len=req.body.length; i<len;i++){
const doc = req.body[i];
context.bindings.documentsToStore.push(doc);
}
context.done(null, {
status: 201, body: 'Processed ' + req.body.length + ' documents'
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.