インテリジェント 支援は、 Data Explorerの統合MongoDB開発サポート用に設計されたAIベースのツールです。自然言語の質問に答え、デバッグ エラーを支援し、パフォーマンス最適化のためのガイダンスを提供します。
注意
インテリジェント 支援は現在public preview段階 です。
AI 機能の有効化
Data Explorerでインテリジェント 支援を使用するには、まず 設定でAI機能を有効にします。
組織レベルで、次の操作を行います。
Atlas で、 Organization Settings ページに移動します。
まだ表示されていない場合は、以下から目的の組織を選択しますナビゲーション バーのOrganizationsメニュー
サイドバーで、Organization Settings をクリックします。
[ Organization Settings ]ページが表示されます。
プロジェクトレベルで、次の操作を行います。
Atlas で、Project Settings ページに移動します。
まだ表示されていない場合は、希望するプロジェクトを含む組織を選択しますナビゲーション バーのOrganizationsメニュー
まだ表示されていない場合は、ナビゲーション バーのProjectsメニューから目的のプロジェクトを選択します。
サイドバーで、Project Settings をクリックします。
[ Project Settings ]ページが表示されます。
インテリジェント エージェントへのアクセス
インテリジェント エージェントにアクセスするには、次の手順に従います。
AtlasGoData ExplorerAtlas で、プロジェクトの ページにGoします。
まだ表示されていない場合は、プロジェクトを含む組織をナビゲーション バーの Organizations メニューで選択します。
まだ表示されていない場合は、ナビゲーション バーの Projects メニューからプロジェクトを選択します。
サイドバーで、 Database見出しの下のData Explorerをクリックします。
Data Explorerが表示されます。
注意
また、Clusters ページに移動し、Shortcuts 見出しの下の Data Explorer をクリックします。

図の 1。支援が折りたたまれた状態のData Explorer のホームページ。

図の 2。支援が展開されたData Explorer のホームページ。
例
次のシナリオでは、 Data Explorerのインテリジェント 支援の使用例を示します。
説明プラン
インテリジェント エージェントに、 MongoDB Compassクエリの出力を分析するようリクエストします。
Interpret this explain plan for me.
## Summary - **Query Logic:** This pipeline counts the number of Italian restaurants in Manhattan by first filtering documents and then aggregating the count. - **Performance:** Fair - **Recommendations:** Create a compound index on `{ borough: 1, cuisine: 1 }` to optimize document retrieval. ## Details ### Query Logic 1. `$match`: Filters documents where `borough` is "Manhattan" and `cuisine` is "Italian". 2. `$count`: Counts the number of documents matching the filter and outputs the total. ### Performance Analysis - The winning plan uses an index scan on the `cuisine` field (`cuisine_1`) and applies an in-memory filter for `borough` ("Manhattan"). - Both `totalKeysExamined` and `totalDocsExamined` are high (43,207), which implies that every document with `cuisine: "Italian"` is examined and then filtered by `borough`. - No compound index exists, meaning MongoDB cannot efficiently combine both filter criteria in a single index lookup. - The pipeline does properly filter before counting, but index usage is only partial, causing increased resource usage. ### Recommendations - Create a compound index on `{ borough: 1, cuisine: 1 }` to allow MongoDB to retrieve documents matching both criteria directly from the index, minimizing documents examined. - This optimization will reduce execution time and system load without changing the output of your aggregation pipeline. Below is the recommended Aggregation Pipeline. This optimized Aggregation Pipeline will leverage the compound index to scan fewer documents, as both filter criteria are present in the index. ```json [ { "$match": { "borough": "Manhattan", "cuisine": "Italian" } }, { "$count": "totalItalianRestaurants" } ] ``` ### Follow-Up Questions 1. How do I create a compound index in MongoDB Compass or via a shell command? 2. What other fields should I consider adding to my indexes for restaurant lookups? 3. How can I further optimize aggregations when working with larger datasets?
ユーザーの質問
次の例は、 Data Explorer の関数とクエリについて、インテリジェント エージェントに質問できることを示しています。
How is MongoDB data modeling different from data modeling with a relational database?
MongoDB data modeling differs from relational database (RDBMS) data modeling in some important ways: 1. Document-Oriented vs. Table-Oriented - MongoDB stores data as flexible, hierarchical JSON-like documents. - Relational databases use tables with fixed schemas and columns. 2. Schema Flexibility - In MongoDB, collections can contain documents with different structures. Schema enforcement is optional. - RDBMS tables have a strict schema that enforces data types and relationships. 3. Embedding vs. Normalization - MongoDB encourages embedding related data inside documents when appropriate (denormalization). Example: An order document may include an array of items directly inside it. - Relational databases emphasize normalization—splitting data across tables connected by foreign keys. 4. Relationships - MongoDB does support references between documents (similar to foreign keys), but joins are less central and not as efficient as in RDBMS. - RDBMSs use normalized data and JOIN operations to relate tables efficiently. 5. Performance & Scaling - MongoDB’s data model enables horizontal scaling (sharding), making it well-suited for large, distributed datasets. - RDBMS scaling typically relies on vertical scaling or complex clustering; JOINs can become expensive as data grows. 6. Use Cases and Design Philosophy - MongoDB models are often designed to optimize common query patterns, reducing the need for joins and complex queries. - RDBMS models are designed for transactional consistency and for representing organized, well-structured relationships. In summary, MongoDB encourages a more flexible, application-driven approach to modeling, while relational databases rely on rigid schemas and normalized relationships. Compass provides tools to visually explore your document structures and relationships, which can be especially helpful as your model evolves.
How can I combine multiple conditions in a single $search query?
To combine multiple conditions in a single $search query in MongoDB Atlas Search (including Compass), you should use the compound operator. The compound operator allows you to specify multiple criteria using must, mustNot, filter, and should clauses. Example: Combine Multiple Conditions Suppose you want to: - Match documents where the plot field contains "baseball" - Exclude documents where the genres field contains "Comedy" or "Romance" Your $search stage would look like this: { "$search": { "compound": { "must": [ { "text": { "query": "baseball", "path": "plot" } } ], "mustNot": [ { "text": { "query": ["Comedy", "Romance"], "path": "genres" } } ] } } }