mongodb 添加字段并设置默认值

db.doc名称.update({}, {$set: {新字段名称: 默认值}}, false, true)

如:db.fly_bill.update({}, {$set: {usableStatus: "0"}}, false, true)

原文地址:https://www.cnblogs.com/yangzhenlong/p/7054733.html