Here is my structure :

M 1 ---->
Produits Array ----->
0 ----->
----> Id: 0
----> Status : 0
----> Id: 1
----> Status : 0
----> Id: 2
----> Status : 0
1 ----->
----> Id: 3
----> Status : 0
----> Id: 4
----> Status : 0
----> Id: 5
----> Status : 0
2 ----->
----> Id: 6
----> Status : 0
----> Id: 7
----> Status : 0
----> Id: 8
----> Status : 0
M 2 ---->
Produits Array ----->
0 ----->
----> Id: 9
----> Status : 0
----> Id: 10
----> Status : 0
----> Id: 11
----> Status : 0
As you can see, the Produits fields in the main objects are an array of objects.
Now I would like to update all Status fields of the objects inside each Produits array where the reference is 2172, 2173, etc. to the value -1
I search on internet and everything I found is some foreach methods which is not providing fast performance for a server.
I also tried with the operator $. But as described in the Mongo documentation, it's only matching the first element of an array. So it won't work if I have more than one element.
So I would like to know if someone has an good idea to update multi item's fields inside an array ?
Thanks in advance