📅  最后修改于: 2022-03-11 15:01:12.541000             🧑  作者: Mango
db.mycollection.find({}).forEach((doc, index) => {
doc.myStr = doc.myStr.replace('foo', 'bar');
db.mycollection.save(doc);
});