sh.getBalancerState()返回: 布尔
sh.getBalancerState()returnstruewhen the balancer is enabled and false if the balancer is disabled. This does not reflect the current state of balancing operations: usesh.isBalancerRunning()to check the current state of the balancer.
提示
兼容性
此方法可用于以下环境中托管的部署:
- MongoDB Atlas: The fully managed service for MongoDB deployments in the cloud
重要
This command is not supported in M0 and Flex clusters. For more information, see Unsupported Commands.
MongoDB Enterprise:基于订阅、自我管理的 MongoDB 版本
MongoDB Community:源代码可用、免费使用且可自行管理的 MongoDB 版本