@BrainTrance_N_A, you can do the update using the array update operator $[<identifier>]
(the link I had provided has the documentation about “filtered positional operator”).
Note that you need to specify a condition to identify the element of the array field vms
to update. I used the "onoma": "nikolas"
as the filter criteria. The query:
db.collection.updateOne(
{},
{ $set: { "vms.$[e].plirwmi.1.0": "99" } },
{ arrayFilters : [ { "e.onoma" : { $eq: "nikolas" } } ] }
)
This modifies "plirwmi": [ [ '0', '1' ], [ '0' ] ]
to:
"plirwmi": [ [ '0', '1' ], [ '99' ] ]
EDIT ADD:
In the expression "vms.$[e].plirwmi.1.0"
, 1.0
represents the index positions of the array field plirwmi
and the inner array. 1
is the second element of plirwmi
array (index 1
; array indexes start from 0
). And, the 0
index is the inner array’s ([ '0' ]
) first element.