

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# 인덱스 속성: 이름
<a name="index-property-name"></a>

## 지원되는 인덱스 유형
<a name="index-property-name-supported"></a>


| 옵션 | 3.6 | 4.0 | 5.0 | 8.0 | 탄력적 클러스터 | 
| --- | --- | --- | --- | --- | --- | 
| 단일 필드 | 예 | 예 | 예 | 예 | 예 | 
| compound | 예 | 예 | 예 | 예 | 예 | 
| 다중 키 | 예 | 예 | 예 | 예 | 예 | 
| 텍스트 | 아니요 | 아니요 | 예 | 예 | 아니요 | 
| 지리 공간 | 예 | 예 | 예 | 예 | 예 | 
| 벡터 | 아니요 | 아니요 | 예 | 예 | 아니요 | 

이름 옵션을 사용하여 인덱스에 대한 선택적 이름을 제공합니다.

모든 예제에서는 다음 샘플 문서를 사용합니다.

```
{
  "productId": "PROD133726",
  "sku": "SKU24224",
  "name": "Basic Printer",
  "manufacturer": "The Manufacturer",
  "tags": [ "printer", "basic", "electronics", "business" ],
  "barcodes": [ "542364671", "886330670", "437445606" ],
  "reviews": [
    {
      "review_date": ISODate('2024-01-19T21:37:10.585Z'),
      ...
    }
  ],
  "material": "Polycarbonate",
  "color": "Space Gray",
  "supplier": {
    "supplierId": "SUP4",
    "location": {
      "type": "Point",
      "coordinates": [ -71.0589, 42.3601 ]
    }
  },
  "productEmbedding": [
    -0.019320633663838058,
    0.019672111388113596
  ],
  "lastUpdated": ISODate('2025-10-20T21:37:10.585Z')
}
```

## 단일 필드
<a name="index-property-name-single-field"></a>

```
db.collection.createIndex(
  {
    "productId": 1
  },
  {
    "name": "single_field_index"
  }
)
```

## 복합
<a name="index-property-name-compound"></a>

```
db.collection.createIndex(
  {
    "productId": 1,
    "manufacturer": 1
  },
  {
    "name": "compound_index"
  }
)
```

## 다중 키
<a name="index-property-name-multi-key"></a>

```
db.collection.createIndex(
  {
    "tags": 1
  },
  {
    "name": "multikey_index"
  }
)
```

## 텍스트
<a name="index-property-name-text"></a>

```
db.collection.createIndex(
  {
    "name": "text"
  },
  {
    "name": "text_index"
  }
)
```

## Geospatial
<a name="index-property-name-geospatial"></a>

```
db.collection.createIndex(
  {
    "supplier.location": "2dsphere"
  },
  {
    "name": "geospatial_index"
  }
)
```

## 벡터
<a name="index-property-name-vector"></a>

```
db.runCommand({
  "createIndexes": "collection", 
  "indexes": [{
    "key": {
      "productEmbedding": "vector"
    },
    "name": "hnsw_index",
    "vectorOptions": {
      "type": "hnsw",
      "dimensions": 2,
      "similarity": "euclidean",
      "m": 16,
      "efConstruction": 64
    }
  }] 
})
```