數據結構

查詢

更新

替換更新值的部分內容
db.getCollection("interface").find({
project_id: 167
}).forEach(function(rep) {
a = rep.path;
print("原字段:" + a);
b = a.replace("AAAAA", "BBBBB");
rep.path = b;
db.getCollection("interface").update({
_id: rep._id
}, {
$set: {
path: b
}
});
c = rep.path;
print("替換后后后:" + c);
})
參考:https://wenku.baidu.com/view/4a7c57c2bbf67c1cfad6195f312b3169a451ea93.html
浙公網安備 33010602011771號