📜  如何从 mongodb 中的文档中删除字段 - 无论代码示例

📅  最后修改于: 2022-03-11 14:57:30.699000             🧑  作者: Mango

代码示例1
=> Use the $unset field update operator to completely remove a field from a document.
{ $unset: { "field_name": "value" } }

=> You can specify multiple fields to remove by separating them with a comma.
{ $unset: { name: "", weight: "" } }