My problem statement is , a user wants to set the in_use property of his IP address of a particular network to ‘true’.
Hi,
You can combine two array update operators $[] and $[] as mentioned in Update Nested Arrays in Conjunction with $[]
For example, in mongo shell:
db.users.update(
{"owners": "SOMEVALUE"},
{"$set":{"networks.$[].ip_pool.$[ip].in_use": true}},
{"arrayFilters":[{"ip.ipaddress":"IPVALUE"}], "multi":true})
Regards,
Wan.