mongodb清空某个字段

db.yourcollection.update({
    "需要删除的字段": {
        "$exists": true
    }
}, {
    "$unset": {
        "需要删除的字段":null
    }
}, {
    multi: true
});

发布了202 篇原创文章 · 获赞 6 · 访问量 3万+

猜你喜欢

转载自blog.csdn.net/fall_hat/article/details/104531245
今日推荐