Created
January 30, 2018 16:56
-
-
Save ealsur/628001d83719f1dfc34f52090bf86200 to your computer and use it in GitHub Desktop.
Azure Cosmos DB + Functions Cookbook - output collector index.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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