mongo刪除指定字段,可多個字段同時刪除

參考代碼:get

db.getCollection('Person').update({"email":{$exists:true}},{$unset:{"email":"","telephone":""}},{multi:true})io

執行後後結果會將Person表全部數據的email、telephone兩個字段都刪除email

相關文章
相關標籤/搜索