对于 AI 代理:可在 https://www.mongodb.com/zh-cn/docs/llms.txt 获取文档索引—通过在任何 URL 路径后添加 .md 可获取所有页面的 Markdown 版本。
Docs 菜单

配置遥测选项

mongosh 收集伪匿名聚合使用数据以改进MongoDB产品。默认下,mongosh 会收集这些数据。 mongosh 仅在交互式和代理会话期间收集数据,不在脚本化会话期间收集数据。您可以随时禁用此数据集合。

mongosh 可以跟踪以下数据:

  • The type of MongoDB mongosh is connected to. For example, Enterprise Edition or Community Edition.

  • 这些方法在 mongosh 中运行。mongosh 仅跟踪方法的名称,而不会跟踪为方法提供的任何参数。

  • 是否使用 mongosh运行脚本。

  • Errors.

  • 您的IP解决。当 mongosh 发送遥测数据时,您的IP解决对端点可见,但 mongosh 不会将其与遥测数据存储。

mongosh 不会跟踪:

  • 用户名或凭证。

  • 查询在 mongosh 中运行。

  • 任何存储在 MongoDB 部署中的数据。

在 mongosh 中使用以下方法切换遥测数据集合。

disableTelemetry()

为 mongosh 禁用遥测。

disableTelemetry()

命令响应确认遥测功能已禁用:

Telemetry is now disabled.

提示

还可以在启动时通过 --eval 启动选项禁用遥测功能。

以下命令可在禁用遥测功能的情况下启动 mongosh:

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

为 mongosh 启用遥测。

enableTelemetry()

命令响应确认已启用遥测:

Telemetry is now enabled.