question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

updating multiple DocumentDB documents from azure function

See original GitHub issue

Hi,

It looks like the current DocumentDB binding is optimized for receiving a single document as input and updating or creating a single document as output.

I’m wanting to write an azure function that is triggered via HTTP and then creates/updates multiple documents and am not sure how to get access to the DocumentDB connection.

In C#, I think I can declare a DocumentClient parameter and then create my documents that way?

But what about in nodeJS? Is there a way to get access to the client in NodeJS? Or do I just need to connect to the DB myself from within my nodeJS function?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
jbrozena22commented, Mar 21, 2017

@mathewc can you elaborate on this:

In Node, you don’t have access to the DocumentClient, but you should be able to assign an array of documents to your output binding and that should work.

I can’t find an example in node that shows how you can bind to multiple database items from an azure function. For instance, if a client sent an array of document IDs, I’d like to bind to each of those documents so I can return each of their results.

Thanks.

0reactions
mathewccommented, Aug 17, 2016

Closing this since I believe your scenario is supported already. Please reopen if you find issues, thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Azure Functions unable to update Multiple Cosmos ...
The below code gives a way to update/upsert for multiple cosmos DB documents through Azure Functions using Java script. Function code:
Read more >
Partial document update - Azure Cosmos DB for NoSQL
Learn how to conditionally modify a document using the partial document update feature in Azure Cosmos DB for NoSQL.
Read more >
Parallelism when using Azure Functions to update a ...
I've recently noticed that I don't get a reliable update when uploading multiple images. Maybe only 6 of the 10 will show in...
Read more >
Azure Cosmos DB bindings for Functions 1.x
The Azure Cosmos DB output binding lets you write a new document to an Azure Cosmos DB database using the SQL API. Output...
Read more >
Azure Cosmos DB trigger for Functions 2.x and higher
The trigger doesn't indicate whether a document was updated or inserted, it just provides the document itself. If you need to handle updates...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found