Answers for "add field for each objec in array on the collection mongo db"

1

add field for each objec in array on the collection mongo db

// Items : Array of Items Contain many Props
// IsDeploied : New Propority i need to add it for each object inside the Items Array For All Documents in the Orders collection
// $[] => this mean add IsDeploied Propority with false value for each Object Inside Items

db.Orders.updateMany({Items: {$exists:true}} , {$set : {'Items.$[].IsDeploied':false}})
Posted by: Guest on March-22-2022

Code answers related to "add field for each objec in array on the collection mongo db"

Browse Popular Code Answers by Language