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.

DocumentDB Inconsistent Update Behavior

See original GitHub issue

In the following code, inputs performed to the input binding are persisted, but the same updates performed to the dynamically bound instance are not persisted:

public static async Task Run(string input, Binder binder, JObject item, TraceWriter log)
{
    JObject document = await binder.BindAsync<JObject>(
new DocumentDBAttribute("ItemDb", "ItemCollection")
    {
        ConnectionStringSetting = "mathewctest_DOCUMENTDB",
        Id = "c31d48aa-d74b-46a3-8ba6-0d4c6f288559"
    });

    log.Info("Item before: " +  document.ToString());
    document["text"] = "Modified!";

    log.Info("Item before: " +  item.ToString());
    item["text"] = "Modified!";
}

The expectation is that these two codepaths behave the same. See SO issue here: http://stackoverflow.com/questions/42007289/azure-functions-update-documentdb-document-with-binder.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
TheeJamesLeecommented, Jul 25, 2017

@brettsam so, does this mean this this section in the docs is wrong?

https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-documentdb#input-sample-in-c

// Change input document contents using DocumentDB API input binding 
public static void Run(string myQueueItem, dynamic inputDocument)
{   
  inputDocument.text = "This has changed.";
}
0reactions
brettsamcommented, Apr 4, 2017

Wouldn’t it affect everyone using Node with these bindings? People may be persisting these changes themselves today. A change here would auto-persist them as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Functional Differences: Amazon DocumentDB and MongoDB
Functional Benefits of Amazon DocumentDBUpdated Functional ... DocumentDB that modify multiple documents that satisfy both atomic and consistent behaviors.
Read more >
How to handle data inconsistency with chained updates in ...
I'm building an application using go and mongodb. Due to my schema design, some informations are stored in multiple places.
Read more >
CosmosDB Inconsistent Read Behavior - Microsoft Q&A
Our team is evaluating CosmosDB and is seeing inconsistent read behavior when querying data through the PHP MongoDB client.
Read more >
MongoDB multi update consistency
So the data is inconsistent, is there any way in which we can fix this kind of problem? I need to mark all...
Read more >
Why MUST an index be sparse to be used in a ...
Can I rely on this behaviour to guarantee that a query containing an { $exists: true } clause is able to use an...
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