Unable to update a nested document element


#1

Hi,

I am trying to update a date field using below query, Also pasted a sample document.
The update statement runs successfully but the value is not changing/updating.

update `jzmedical` as c
set p.expirationDate.ticks=str_to_millis('2018-12-31')
for p in c.parts end
where meta(c).id > 'container_' and meta(c).id < 'container_x' and substr(meta(c).id, -9, 9) != '_AuditLog' 
and p.lotCode='HN6094'

container_9bf65d3ceeed422a8a3b57bf0d9d5d00:

{
“name”: “container name1”,
“parts”: [
{
“expirationDate”: {
“ticks”: 1672444800000,
“tz”: “Etc/UTC”
},
“lotCode”: “HN7585”,
“name”: “partname 1”,
“partNumber”: “152455678”
},
{
“expirationDate”: {
“ticks”: 1672444800000,
“tz”: “Etc/UTC”
},
“lotCode”: “HN6094”,
“name”: “partname 2”,
“partNumber”: “64320416”
}
]
}


#2
UPDATE `jzmedical` AS c
SET p.expirationDate.ticks=STR_TO_MILLIS('2018-12-31')
FOR p IN c.parts WHEN p.lotCode='HN6094' END
WHERE META(c).id > 'container_' AND META(c).id < 'container_x'
      AND SUBSTR(META(c).id, -9, 9) != '_AuditLog'
      AND ANY p1 IN c.parts SATISFIES p1.lotCode='HN6094' END;