'how can I update specific object of inside an array of object using mongo query?

Can I use any query using which I can push some extra parameter in the all the object whereever I have name user1 in the object?

{ 'id': '1', 'data': [ { 'name': 'user1', 'active': 'yes' }, { 'name': 'user2', 'active': 'yes' }, { 'additinaldetails' : 'true', 'data': { 'address': 'address', 'users': [ { 'status': 'active', 'details':[ { 'name': 'user1', 'active': 'yes' }, { 'name': 'user2', 'active': 'yes' } ] } ] } } ] }



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source