db.students.insertOne({"_id":1,"grades":[80, 85, 90]})
db.students.insertOne({"_id":2,"grades":[88, 90, 92]})
db.students.insertOne({"_id":3,"grades":[85, 100, 90]})
需求1、把_id为1的文档的grades数组中的85改成88
db.students.updateOne({"_id":1, "grades":85}, {"$set":{"grades.$":88}})
需求2、把_id为1的文档的grades数组中的
标签:students,第八篇,db,88,grades,数组,mongodb,id,85 From: https://www.cnblogs.com/koushr/p/16698352.html