Update a vertex property when another sibling property matches a certain value
So I'm running the following query on a vertex and the goal is to update meta properties and a vertex property and that matches the provided values on a sibling vertex property. I'm able to update the meta properties but not the sibling property.
g.V('1').hasLabel('label').properties('FirstSet').has('id','1').property('date','1/1/2023')
“FirstSet”: [
{
"id": "1",
"value": "1",
"label": "label",
"properties": {
"Date": "12/12/2023"
}
},
{
"id": "2",
"value": "value1",
"label": "label",
"properties": {
"Date": "1/1/2023"
}
}
]
Using this I'm able to update the values inside the "properties" object that is date, but I'd also like to update the value field that is after the id value, so basically where id is 1 update the value and date to the new provided values.
g.V('1').hasLabel('label').properties('FirstSet').has('id','1').property('value','newValue')
I tried the query above but it adds a new field 'value' on the meta properties instead of updating the existing value property, which is very obvious to happen
RESULTS RECEIVED:
“FirstSet”: [
{
"id": "1",
"value": "1",
"label": "label",
"properties": {
"Date": "12/12/2023",
"value" : "newValue"
}
},
{
"id": "2",
"value": "value1",
"label": "label",
"properties": {
"Date": "1/1/2023"
}
}
]
EXPECTED RESULT:
“FirstSet”: [
{
"id": "1",
"value": "newValue",
"label": "label",
"properties": {
"Date": "12/12/2023"
}
},
{
"id": "2",
"value": "value1",
"label": "label",
"properties": {
"Date": "1/1/2023"
}
}