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