getLastError
在此页面上
已在 MongoDB 5.1 中删除。
Any code explicitly using getLastError
, db.getLastError()
, or
db.getLastErrorObj()
should instead use the CRUD API to issue the
write with the desired 写入安全机制.
Information about the success or failure of the write operation will be
provided directly by the driver as a return value.
兼容性
此命令可用于以下环境中托管的部署:
MongoDB Enterprise:基于订阅、自我管理的 MongoDB 版本
MongoDB Community:源代码可用、免费使用且可自行管理的 MongoDB 版本
重要
MongoDB Atlas集群不支持此命令。 有关Atlas支持所有命令的信息,请参阅不支持的命令。