📅  最后修改于: 2022-03-11 15:04:25.283000             🧑  作者: Mango
//just read documentaion in source and see how to use the $ sign !!
myDataBase.updateOne({ 'project': 'test2', 'issues._id': new ObjectID('61006f2409a2524514d877ce') }, { $set: { 'issues.$.open': true, 'issues.$.updated_on': new Date() } })
//for mongodb 4+
const ObjectId = require('mongodb').ObjectId;