MongoDB how to update documents

Published: 22 July 2024
on channel: Bro Code
3,694
86

#MongoDB #course #tutorial

00:00:00 updateOne()
00:04:14 updateMany()
00:07:30 MongoDB Compass

db.students.updateOne({name:"Spongebob"}, {$set:{fullTime:true}})
db.students.updateOne({_id: ObjectId("642c0e70985f18e1bcf24d35")}, {$set:{fullTime:false}})
db.students.updateOne({_id: ObjectId("642c0e70985f18e1bcf24d35")}, {$unset:{fullTime:""}})
db.students.updateMany({}, {$set:{fullTime:false}})
db.students.updateOne({name:"Gary"}, {$unset:{fullTime:""}})
db.students.updateOne({name:"Sandy"}, {$unset:{fullTime:""}})
db.students.updateMany({fullTime:{$exists:false}}, {$set:{fullTime:true}})


Watch video MongoDB how to update documents online, duration hours minute second in high quality that is uploaded to the channel Bro Code 22 July 2024. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 3,694 times and liked it 86 visitors.