Loading

mongodb删除某个字段

db.yourcollection.update({
    "需要删除的字段": {
        "$exists": true
    }
}, {
    "$unset": {
        "需要删除的字段":null
    }
}, {
    multi: true
});
posted @ 2023-05-16 15:34  拾月凄辰  阅读(221)  评论(0编辑  收藏  举报