지능형 비서는 데이터 탐색기 의 통합 MongoDB 개발 지원 위해 설계된 AI 기반 도구입니다. 언어 질문에 답변하고, 오류 디버깅을 지원하며, 성능 최적화를 위한 지침 제공합니다.
참고
지능형 비서는 현재 공개 미리 보기로 제공됩니다.
AI 기능 활성화
데이터 탐색기 에서 지능형 어시스턴트를 사용하려면 먼저 설정에서 AI 기능을 활성화 .
조직 수준에서:
Atlas에서 Organization Settings 페이지로 이동합니다.
경고: 탐색 기능 개선 작업 진행 중
현재 새롭고 향상된 탐색 환경을 출시하고 있습니다. 다음 단계가 Atlas UI 의 보기와 일치하지 않는 경우 미리 보기 설명서를 참조하세요.
아직 표시되지 않은 경우 다음 목록에서 원하는 조직 을 선택하세요. 탐색 표시줄의 Organizations 메뉴.
1} 메뉴 옆에 있는 아이콘을 클릭합니다.Organization Settings Organizations
조직 설정 페이지가 표시됩니다.
프로젝트 수준에서:
Atlas에서 Project Settings 페이지로 이동합니다.
경고: 탐색 기능 개선 작업 진행 중
현재 새롭고 향상된 탐색 환경을 출시하고 있습니다. 다음 단계가 Atlas UI 의 보기와 일치하지 않는 경우 미리 보기 설명서를 참조하세요.
아직 표시되지 않은 경우 탐색 표시줄의 Organizations 메뉴에서 원하는 프로젝트가 포함된 조직을 선택합니다.
아직 표시되지 않은 경우 탐색 표시줄의 Projects 메뉴에서 원하는 프로젝트를 선택합니다.
Projects 메뉴 옆에 있는 Options 메뉴를 펼친 다음 Project Settings 를 클릭합니다.
프로젝트 설정 페이지가 표시됩니다.
지능형 어시스턴트 액세스
데이터 탐색기 에서 지능형 어시스턴트에 액세스 하려면 이 있는 사이드바 패널을 클릭합니다. 그러면 쿼리 출력과 관련된 다양한 질문을 하고, 계획 통계를 설명하는 등의 작업을 수행할 수 있는 어시스턴트가 열립니다.

그림 1. 어시스턴트가 접힌 데이터 탐색기 홈페이지.

그림 2. 어시스턴트가 확장된 데이터 탐색기 홈 페이지입니다.
예시
다음 시나리오는 데이터 탐색기 에서 지능형 비서를 사용하는 여러 가지 방법을 보여줍니다.
설명 계획
지능형 어시스턴트에게 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?
사용자 질문
다음 예제는 데이터 탐색기 함수 및 쿼리에 대해 지능형 어시스턴트에게 질문할 수 있는 질문을 보여줍니다.
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" } } ] } } }