@Abra_Sata, to update an element in an array, you need to know the value of the element or the field value of the nested document. If you want to know the array element position (e.g., index 4, the fifth element), and use its value in calling another external function, I don’t know if its possible.
The Updates with Aggregation Pipeline feature allows using JavaScript function within an update operation using the $function operator. Maybe you can try using this feature to accommodate your custom function code. Here is a post as an example usage: