'Update multiple array object in mongodb by sending Array of id using spring boot

New to mongodb want to update document having multiple array inside that just by passing array of id

have some query idea but don't know that we can write in mongo or in spring boot

 ids = ["1", "5", "7"];
 visibility = true;

array.update({_id: {$in: ids}}, 
   { $set: { visibility } }, 
   {multi: true} 
});

need t0o write code in spring boot help on this thanks



Sources

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

Source: Stack Overflow

Solution Source