定义
setParametersetParameteris an administrative command for modifying options normally set on the command line. You must issue thesetParametercommand against the admin database.
兼容性
此命令可用于以下环境中托管的部署:
MongoDB Enterprise:基于订阅、自我管理的 MongoDB 版本
MongoDB Community:源代码可用、免费使用且可自行管理的 MongoDB 版本
重要
MongoDB Atlas 集群不支持此命令。有关 Atlas 对所有命令的支持的信息,请参阅不支持的命令。
语法
db.adminCommand( { setParameter: 1, <parameter>: <value> } )
有关可用参数(包括示例),请参阅适用于自托管部署的MongoDB Server参数。
行为
持久性
Commands issued by the admin command setParameter do not survive server restarts. For a persistent option use the --setParameter command line option or the setParameter configuration file setting.
Stable API
使用 Stable API V1 且 apiStrict设立为 true时,您无法使用setParameter 修改服务器参数。