This command is supported in all MongoDB Atlas clusters. For information on Atlas support for all commands, see Unsupported Commands. MongoDB Enterprise: The subscription-based, self-managed version of MongoDB
MongoDB\Exception\UnsupportedException,如果所选服务器使用了选项但不支持选项(例如collation、readConcern、writeConcern)。 MongoDB\Exception\InvalidArgumentException 用于与参数或选项解析相关的错误。 MongoDB\ 驱动程序\Exception\BulkWriteCommandException 以了解与写入操作相关的错误。您可以检查 getWriteErrors() ...
MongoDB will add the_idfield to the replacement document if it is not specified in either thefilterorreplacementdocuments. If_idis present in both, the values must be equal. To avoid multiple upserts, ensure that thequeryfields areuniquely indexed. ...
MongoDB Enterprise:基于订阅、自我管理的 MongoDB 版本 MongoDB Community:源代码可用、免费使用且可自行管理的 MongoDB 版本 语法 findOneAndReplace()方法采用以下形式: db.collection.findOneAndReplace( <filter>, <replacement>, { writeConcern: <document>, ...
MongoDB\Collection::findOneAndReplace() Finds a single document matching the query and replaces it. function findOneAndReplace( array|object $filter, array|object $replacement, array $options = [] ): object|nullParameters $filter : array|object The filter criteria that specifies the docum...