Skip to content

Instantly share code, notes, and snippets.

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

Embed
What would you like to do?
Azure Cosmos DB + Functions Cookbook - HTTP query nodejs
module.exports = function (context, req) {
var documents = context.bindings.documents;
var totalDocuments = documents.length;
context.log('Found '+ totalDocuments +' documents');
if(totalDocuments === 0){
context.res = {
status: 404,
body : "No documents found"
};
}
else {
context.res = {
body: documents
};
}
context.done();
};
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.