Docs HomeMongoDB Shell

Configure Telemetry Options配置遥测选项

mongosh collects anonymous aggregated usage data to improve MongoDB products. mongosh集合匿名聚合使用数据以改进MongoDB产品。mongosh collects this information by default, but you can disable this data collection at any time.mongosh默认情况下会集合这些信息,但您可以随时禁用此数据集合。

Data Tracked by mongoshmongosh追踪的数据

mongosh tracks the following data:mongosh跟踪以下数据:

  • The type of MongoDB mongosh is connected to. MongoDB mongosh连接到的类型。For example, Enterprise Edition, Community Edition, or Atlas Data Lake.例如,Enterprise Edition、Community Edition或Atlas Data Lake。
  • The methods run in mongosh. 这些方法在mongosh中运行。mongosh only tracks the names of the methods, and does not track any arguments supplied to methods.mongosh只跟踪方法的名称,不跟踪提供给方法的任何参数。
  • Whether users run scripts with mongosh.用户是否使用mongosh运行脚本。
  • Errors.错误。

mongosh does not track:不跟踪:

  • IP addresses, hostnames, usernames, or credentials.IP地址、主机名、用户名或凭据。
  • Queries run in mongosh.查询在mongosh中运行。
  • Any data stored in your MongoDB deployment.存储在MongoDB部署中的任何数据。
  • Personal identifiable information.个人身份信息。

For more information, see MongoDB's Privacy Policy.有关更多信息,请参阅MongoDB的隐私政策

Toggle Telemetry Collection切换遥测采集

Use the following methods in mongosh to toggle telemetry data collection.mongosh中使用以下方法来切换遥测数据集合。

disableTelemetry()

Disable telemetry for mongosh.禁用mongosh的遥测。

disableTelemetry()

The command response confirms that telemetry is disabled:命令响应确认遥测被禁用:

Telemetry is now disabled.
Tip

You can also disable telemetry at startup by using the --eval startup option.您还可以使用--eval startup选项在启动时禁用遥测。

The following command starts mongosh with telemetry disabled:以下命令在禁用遥测的情况下启动mongosh

mongosh --nodb --eval "disableTelemetry()"
enableTelemetry()

Enable telemetry for mongosh.启用mongosh的遥测。

enableTelemetry()

The command response confirms that telemetry is enabled:命令响应确认遥测已启用:

Telemetry is now enabled.