Modifying an object in the array

Hi ,

{
“values”: [
{
“box”: “BOX1982”
},
{
“box”: “BOX1983”
},
{
“box”: “BOX1984”
}
],
“infomation”: {
“time”: “2019-04-15 23.42.56”,
“inputs”: [
{
“type”: “BOX”,
“make”: “CAR BOARD”,
“code”: “12345678”
}
]
}
}

O/P expected is the information objects containing the count of the box values

{
“values”: [
{
“box”: “BOX1982”
},
{
“box”: “BOX1983”
},
{
“box”: “BOX1984”
}
],
“infomation”: {
“time”: “2019-04-15 23.42.56”,
“inputs”: [
{
“type”: “BOX”,
“make”: “CAR BOARD”,
“code”: “12345678”,
“count”: “3”
}
]
}
}

Any help is appreciated

UPDATE default AS d
SET    input.`count` =     ARRAY_COUNT(ARRAY  v 
                                        FOR v IN d.`values` 
                                        WHEN v.[lower(input.type)] IS NOT MISSING 
                                        END)
            FOR input IN d.information.inputs END
WHERE  ...