// 注意上面的集合要和下面的集合名稱相同
db.rand_web_test.find(
{
'content': /^.*要替換的字符串.*$/
}
).forEach(
function (item) {
var tmp = String(item.content)
tmp = tmp.replace(/要替換的字符串/g,'替換成字符串')
if (tmp == null){
print(item.content)
}
item.content = tmp ;
// print(tmp)
print(db.rand_web_test.save(item))
// db.rand_web_test.save(item)
}
)
