How can I read the data that i just inserted using Azure Functions on CosmoDB ?

Anandha Vellapandian 0 Reputation points
2023-09-28T09:43:09.79+00:00

In Azure Functions, i have setup a In Binding and Out binding. Both these point to 'same' Collection in Azure Cosmo DB.

The retrieval and insert work at the same time.

But I am planning to read the document in a collection (by id through in binding), add one subdocument to it, and persist (outbinding) and get the updated record through in binding. is it possible ? Or I am violating any of the principles of IN and Out binding.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,875 questions
Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,609 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 70,136 Reputation points
    2023-09-28T11:19:04.4+00:00

    @Anandha Vellapandian Thanks for reaching out. Yes, it is possible to read a document from a collection using an input binding, add a subdocument to it, and then persist the updated document using an output binding. In output binding you can pass any object as per your need. In your case if you want to add a subdocument then you can modify it first and then send to the output binding.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.