Mongodb使用
use MuZhaoDi
db.grade.insertMany([ { courseName: "ComputerNetwork", score: 99, teacher: "HuYingXin", examDate: "2024/6" }, { courseName: "MaoGai", score: 85, teacher: "MrHu", examDate: "2024/6" }, { courseName: "ProjectMath", score: 91, teacher: "MsZhang", examDate: "2024/6" }, { courseName: "Database", score: 95, teacher: "MrYang", examDate: "2024/6" }, { courseName: "ProbabilityMath", score: 89, teacher: "MrBai", examDate: "2024/6" } ])
db.grade.insertOne({ courseName: "OperatingSystem", score: 92, teacher: "MsLi", examDate: "2024/6" })
db.grade.deleteOne({ courseName: "MaoGai" })
db.grade.updateOne({ courseName: "ProjectMath" }, { $set: { score: 93 } })
db.grade.find()
db.grade.find({ courseName: "ComputerNetwork" })
exit
sudo systemctl stop mongod