将字段mp4_filepath中的http://188.192.162.12:8904批量替换成http://188.192.162.12:81
db.getCollection('test').find({'mp4_filepath':{'$ne':null}, 'mp4_filepath':/^http:\/\/188.192.162.12:8904/}).
forEach(
function(item) {
var tmp = String(item.mp4_filepath)
if (tmp == null){
print(item.mp4_filepath)
}
else{
tmp = tmp.replace(/^http:\/\/188.192.162.12:8904/g,"http://188.192.162.70:81");
}
item.mp4_filepath = tmp ;
db.getCollection('test').save(item);
print("update to " + item.mp4_filepath)
}
);