📅  最后修改于: 2022-03-11 15:03:55.189000             🧑  作者: Mango
db.collection.updateMany(
{ name: { $regex: stringToReplace } },
[{
$set: { name: {
$replaceAll: { input: "$name", find: stringToReplace, replacement: "" }
}}
}]
)