Docs Menu
Docs Home
/ /

데이터 탐색기 의 지능형 어시스턴트

지능형 비서는 데이터 탐색기 의 통합 MongoDB 개발 지원 위해 설계된 AI 기반 도구입니다. 언어 질문에 답변하고, 오류 디버깅을 지원하며, 성능 최적화를 위한 지침 제공합니다.

데이터 탐색기 에서 지능형 어시스턴트를 사용하려면 먼저 설정에서 AI 기능을 활성화 .

조직 수준에서:

1
  1. 아직 표시되지 않은 경우 다음 목록에서 원하는 조직 을 선택하세요. 탐색 표시줄의 Organizations 메뉴.

  2. 사이드바에서 Organization Settings를 클릭합니다.

Organization Settings(조직 설정) 페이지가 표시됩니다.

2

프로젝트 수준에서:

1
  1. 아직 표시되지 않은 경우 탐색 표시줄의 Organizations 메뉴에서 원하는 프로젝트가 포함된 조직을 선택합니다.

  2. 아직 표시되지 않은 경우 탐색 표시줄의 Projects 메뉴에서 원하는 프로젝트를 선택합니다.

  3. 사이드바에서 Project Settings를 클릭합니다.

프로젝트 설정 페이지가 표시됩니다.

2

Enable Data Explorer Generative AI Features 토글을 on 으로 설정합니다.

3

데이터 탐색기의 생성형 인공지능 사용에 대한 자세한 내용은 다음을 참조하세요.

  • AI 및 데이터 사용량 정보

  • MongoDB 생성형 인공지능 기능에 대한 FAQ

지능형 어시스턴트 액세스 하려면 다음을 수행합니다.

1
  1. 아직 표시되지 않은 경우 탐색 표시줄의 Organizations 메뉴에서 프로젝트가 포함된 조직을 선택합니다.

  2. 아직 표시되지 않은 경우 내비게이션 바의 Projects 메뉴에서 프로젝트를 선택합니다.

  3. 사이드바에서 Database 제목 아래의 Data Explorer를 클릭합니다.

    데이터 탐색기 가 표시됩니다.

AI 드로어가 접힌 데이터 탐색기 페이지
클릭하여 확대

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

AI 드로어가 열린 데이터 탐색기 페이지
클릭하여 확대

그림 2. 어시스턴트가 확장된 데이터 탐색기 홈 페이지입니다.

데이터 탐색기 어시스턴트의 읽기 전용 도구는 현재 작업 에서 컨텍스트를 가져오거나 사람의 승인을 받아 연결된 MongoDB deployment 대해 데이터베이스 작업을 실행할 수 있습니다. 대화형 응답과 달리 이러한 도구는 실제 데이터베이스 쿼리를 수행하고 데이터베이스 에서 실시간 데이터를 반환할 수 있습니다.

어시스턴트 도구의 주요 특성은 다음과 같습니다.

  • 읽기 전용: 도구로 데이터를 수정, 삽입, 업데이트 또는 삭제 수 없습니다.

  • 사용자 승인: 모든 도구를 실행할 때는 명시적인 사용자 확인이 필요합니다.

  • 컨텍스트: 어시스턴트는 도구를 호출하기로 결정할 때 현재 데이터베이스, 컬렉션 및 연결을 고려합니다.

  • 라이브 데이터: 연결된 MongoDB deployment 에서 실시간 으로 결과가 제공됩니다.

다음 도구는 사용자를 위해 민감한 콘텐츠를 가져오며 확인이 필요합니다. 이러한 도구는 데이터베이스 와 상호 작용 하지 않지만 사용하기 전에 사용자 확인이 필요합니다.

데이터 탐색기 도구 이름
설명

get-current-query

쿼리 표시줄에서 활성 MongoDB 쿼리 매개변수를 추출합니다.

get-current-pipeline

집계 빌더에서 활성 집계 파이프라인 추출합니다.

데이터베이스 도구 이름
설명

list-databases

MongoDB deployment 에서 사용할 수 있는 모든 데이터베이스를 저장 크기와 함께 표시합니다.

list-collections

특정 데이터베이스 내의 모든 컬렉션을 표시합니다.

find

특정 검색 기준과 일치하는 컬렉션 에서 실제 문서를 조회합니다.

count

문서 자체를 검색하지 않고 컬렉션 에 있는 총 문서 수를 빠르게 반환합니다.

aggregate

문서 전체에서 그룹화, 필터링, 변환, 통계 계산과 같은 복잡한 데이터 처리 작업을 수행합니다.

collection-indexes

컬렉션 에 정의된 모든 인덱스를 나열합니다.

collection-schema

컬렉션 분석하여 필드 이름 및 데이터 유형을 포함한 문서 구조를 표시합니다.

collection-storage-size

데이터와 인덱스를 모두 포함하여 컬렉션 차지하는 물리적 디스크 공간을 보고합니다.

db-stats

컬렉션 수, 문서 총계, 저장 사용량 및 인덱스 통계를 포함하여 데이터베이스 상태에 대한 포괄적인 개요를 제공합니다.

mongodb-logs

문제 해결, 성능 모니터링 , 보안 감사를 위해 최근 서버 로그를 조회합니다.

explain

자세한 쿼리 실행 계획과 성능 통계를 표시하여 MongoDB 쿼리 처리하는 방법과 인덱스 사용 여부를 보여줍니다.

참고

집계 파이프라인 단계 $out$merge 는 쓰기 (write) 작업을 수행하므로 도구 호출에서 지원되지 않습니다. 어시스턴트는 읽기 전용 도구만 지원합니다.

1

도구는 기본값 으로 활성화되어 있지만 입력 표시줄의 Tools 버튼을 사용하여 도구를 켜거나 끌 수 있습니다.

2

연결이 활성화되어 있고 관련 페이지가 표시되어 있는지 확인합니다. 질문하려면 활성 연결과 관련된 탭 에 있어야 합니다.

3

데이터에 대해 묻는 프롬프트를 제출합니다( 예시: '모든 데이터베이스 나열').

4

어시스턴트가 사용자의 의도를 감지하고 보류 상태 의 도구 카드를 표시합니다. 이 목록에는 도구 카드가 표시할 수 있는 가능한 요소가 나열되어 있습니다.

  • 도구 이름 작업

  • 배포서버(호스팅하다/엔드포인트)

  • 쿼리 중인 데이터베이스 및 컬렉션

  • 모든 매개변수 또는 필터

  • RunCancel 버튼

위 예시 경우 도구 카드에 'list-databases'가 표시됩니다.

5
6

결과 예시:

Here are the databases found on your MongoDB deployment:
- sample_mflix (Size: 183,685,120 bytes)
- admin (Size: 364,544 bytes)
- local (Size: 21,907,722,240 bytes)
If you want details about collections in any of these databases,
just let me know!

다음 시나리오는 데이터 탐색기 에서 지능형 비서를 사용하는 여러 가지 방법을 보여줍니다.

지능형 어시스턴트에게 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"
}
}
]
}
}
}

돌아가기

프롬프트 애그리게이션

이 페이지의 내용