Docs Home / Compass / Interact with Your Data / Query with Natural Language

Enable Natural Language Querying启用自然语言查询

You can enable Compass natural language querying by toggling the Use Generative AI setting. Natural language queries can be a helpful starting point and assist you in learning to write MongoDB queries.您可以通过切换“使用生成AI”设置来启用Compass自然语言查询。自然语言查询可以作为一个有用的起点,帮助您学习编写MongoDB查询。

About this Task关于此任务

To enable natural language querying in Compass, follow the steps below.要在Compass中启用自然语言查询,请按照以下步骤操作。

Before you Begin开始之前

To enable the generation of queries and aggregations in Compass, you must:要在Compass中启用查询和聚合的生成,您必须:

  • Install Compass version 1.40.0 or later. For instructions on downloading and installing the latest version, see Download and Install Compass.安装Compass 1.40.0或更高版本。有关下载和安装最新版本的说明,请参阅下载和安装Compass

Note

You can also enable Natural Language Querying using the configuration file. For details, see Configuration File Settings.您还可以使用配置文件启用自然语言查询。有关详细信息,请参阅配置文件设置

Steps步骤

1

Open settings打开设置

Operating System操作系统Description描述Keyboard Shortcut键盘快捷键
Windows / LinuxIn the top menu bar, click Edit.在顶部菜单栏中,单击“编辑”。Ctrl + ,
macOSIn the top menu bar, click MongoDB Compass.在顶部菜单栏中,单击MongoDB Compass。 + ,
2

Enable AI Features启用AI功能

You only need to enable AI features if it is your first time using natural language querying.您只需要在第一次使用自然语言查询时启用AI功能。

  1. Select Artificial Intelligence.选择“人工智能”。
  2. Click the Enable AI Features check box.单击“启用AI功能”复选框。
3

(Optional) Read MongoDB's GenAI FAQs(可选)阅读MongoDB的GenAI常见问题

For more information about generative AI usage with MongoDB Compass, see:有关MongoDB Compass生成AI使用的更多信息,请参阅:

Next Steps后续步骤

Prompt a Natural Language Query提示自然语言查询