定义
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 版本
重要
This command is not supported in MongoDB Atlas clusters. For information on Atlas support for all commands, see Unsupported Commands.
语法
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
When using Stable API V1 with apiStrict set to true, you cannot use setParameter to modify server parameters.