I have several documents. Below I will list just two. How do I update the value of the "Value field" that is below the "Name field: StartDate" in all documents?
Example: 10/10/2019 to 09/09/2019 01/01/2019 to 09/09/2019
Document 1:
{
"IdLoginTwm": 4330,
"Parametros": [
{
"Name": "UserName",
"Value": "[email protected]"
},
{
"Name ": "StartDate",
"Value ": "10/10/2019"
}
]
}
Document 2:
{
"IdLoginTwm": 4330,
"Parametros": [
{
"Name": "UserName",
"Value": "[email protected]"
},
{
"Name ": "FirstName",
"Value ": "diego"
},
{
"Name ": "StartDate",
"Value ": "01/01/2019"
}
]
}
Thanks!!
You can use the PatchByQueryOperation() for this.
https://ravendb.net/docs/article-page/4.2/Csharp/client-api/operations/patching/set-based#patching-how-to-perform-set-based-operations-on-documents
The patch script should be similar to below