批量刪除字段:get
{multi:true}:查詢到的全部記錄都刪除。io
db.collection_name.update({"target_field":{"$exists":true}},{"$unset":{"target_field":1}},{multi:true})date
批量從新名字段名:查詢
db.collection_name.update(filter,{$rename : {"source_field":"target_field"}},{"multi":1});filter