PHP Conference Japan 2024

MongoDB\Driver\ServerApi::__construct

(mongodb >=1.10.0)

MongoDB\Driver\ServerApi::__construct创建一个新的 ServerApi 实例

描述

final public MongoDB\Driver\ServerApi::__construct(string $version, ?bool $strict = null, ?bool $deprecationErrors = null)

创建一个新的MongoDB\Driver\ServerApi 实例,用于在创建 MongoDB\Driver\Manager 时声明 API 版本。

参数

version

服务器 API 版本。

支持的API版本在MongoDB\Driver\ServerApi中以常量的形式提供。唯一支持的API版本是MongoDB\Driver\ServerApi::V1

strict

如果strict参数设置为true,则服务器将对任何不属于指定API版本的命令产生错误。如果未提供值,则使用服务器默认值(false)。

deprecationErrors

如果deprecationErrors参数设置为true,则服务器在使用指定API版本中已弃用的命令时将产生错误。如果未提供值,则使用服务器默认值(false)。

添加笔记

用户贡献笔记

此页面没有用户贡献的笔记。
To Top