# DataStoreKeyInfo

DataStoreKeyInfo : `Instance`

## Overview

데이터 저장소에서 특정 키의 버전 정보를 담고 있는 객체입니다.

GlobalDataStore의 GetAsync와 UpdateAsync 메서드를 호출하면, 이 객체가 반환되어 해당 키가 어떤 버전 상태였는지 확인할 수 있습니다.

## Properties

### CreatedTime

`number`

해당 객체가 만들어진 날짜와 시간을 나타내는 속성입니다.

Unix Epoch(1970-01-01 00:00:00 UTC)부터 경과한 시간을 밀리초 단위로 표현합니다.

#### Code Samples

```lua
local DataStoreService = game:GetService("DataStoreService") 
local GoldStore = DataStoreService:GetDataStore("PlayerGold")

local success, errorMessageOrLoadValue, keyInfo = pcall(function()
    return GoldStore:GetAsync(player.UserId)
end)

if not success then
    print("errorMessage : ", errorMessageOrLoadValue)
else
    local loadValue = errorMessageOrLoadValue
    local createdTime = keyInfo.CreatedTime
    local version = keyInfo.Version
    local updatedTime = keyInfo.UpdatedTime
end
```

### UpdatedTime

`double`

해당 객체가 수정된 날짜와 시간을 나타내는 속성입니다.

Unix Epoch(1970-01-01 00:00:00 UTC)부터 경과한 시간을 밀리초 단위로 표현합니다.

#### Code Samples

```lua
local DataStoreService = game:GetService("DataStoreService") 
local GoldStore = DataStoreService:GetDataStore("PlayerGold")

local success, errorMessageOrLoadValue, keyInfo = pcall(function()
    return GoldStore:GetAsync(player.UserId)
end)

if not success then
    print("errorMessage : ", errorMessageOrLoadValue)
else
    local loadValue = errorMessageOrLoadValue
    local createdTime = keyInfo.CreatedTime
    local version = keyInfo.Version
    local updatedTime = keyInfo.UpdatedTime
end
```

### Version

`string`

해당 객체가 가진 개별 버전을 구분하도록 설계된 고유 식별자입니다.

#### Code Samples

```lua
local DataStoreService = game:GetService("DataStoreService") 
local GoldStore = DataStoreService:GetDataStore("PlayerGold")

local success, errorMessageOrLoadValue, keyInfo = pcall(function()
    return GoldStore:GetAsync(player.UserId)
end)

if not success then
    print("errorMessage : ", errorMessageOrLoadValue)
else
    local loadValue = errorMessageOrLoadValue
    local createdTime = keyInfo.CreatedTime
    local version = keyInfo.Version
    local updatedTime = keyInfo.UpdatedTime
end
```

## Methods

### GetMetadata

해당 객체가 가진 부가 정보(메타데이터)를 반환합니다.

#### Parameters

#### Return

| `Dictionary` | 키-값 형태의 부가 정보(메타데이터)입니다. |
| ------------ | ------------------------ |

#### Code Samples

```lua
local DataStoreService = game:GetService("DataStoreService") 
local GoldStore = DataStoreService:GetDataStore("PlayerGold")

local success, errorMessageOrLoadValue, keyInfo = pcall(function()
    return GoldStore:GetAsync(player.UserId)
end)

if not success then
    print("errorMessage : ", errorMessageOrLoadValue)
else
    local loadValue = errorMessageOrLoadValue
    local metadata = keyInfo:GetMetadata()
    
    print(metadata)
end
```

### GetUserIds

해당 객체가 가진 사용자 ID 배열을 반환합니다.

#### Parameters

#### Return

| `Array` | 사용자 ID 배열입니다. |
| ------- | ------------- |

#### Code Samples

```lua
local DataStoreService = game:GetService("DataStoreService") 
local GoldStore = DataStoreService:GetDataStore("PlayerGold")

local success, errorMessageOrLoadValue, keyInfo = pcall(function()
    return GoldStore:GetAsync(player.UserId)
end)

if not success then
    print("errorMessage : ", errorMessageOrLoadValue)
else
    local loadValue = errorMessageOrLoadValue
    local userIds = keyInfo:GetUserIds()
    
    print(userIds)
end
```

## Events
