【发布时间】:2021-08-22 18:25:30
【问题描述】:
我正在尝试在 MongoDB v5.0 中进行以下查询 db.test.insertOne({"test":"value"}) db.test.update({"test":"value"},{}) ...这会引发一个错误,说“未捕获的 MongoDriverError:更新文档需要原子操作符”但之前(MongoDB 4.4.2)这曾经通过并且将文档更新为空。为什么不再允许这样做?
我已经检查了下面的这个问题,但是关于 $set、$unset 运算符和上面的查询似乎工作正常。 Why does MongoDB no longer allow using $set and $unset with an empty document? . PSI 图片说明上述问题:- Problem
【问题讨论】:
标签: mongodb mongodb-query