I have the following document:
{
_id: objectId("5aa7abb3c7dc133b0007e6e"),
name: "first course",
targets: Array
0: Object
id: "11111_rrrr",
value: "test"
1: Object
id: "22222_rrrr",
value: "hi"
}
so, I want to change the value of the array[i]. my solution is :
$update = array(
'targets.$[].value' => "New Value"
);
$result = Course::where("_id", $course_id)->update($update);
it changes all the value of the array, how can I solve my problem??