> For the complete documentation index, see [llms.txt](https://docs.overdare.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.overdare.com/development/api-reference/classes/datastorekeyinfo.md).

# DataStoreKeyInfo

DataStoreKeyInfo : `Instance`

## Overview

An object that contains version information of a specific key in data storage.

When GetAsync or UpdateAsync method of GlobalDataStore is called, this object is returned to for user to check what version a specific key was.

## Properties

### CreatedTime

`number`

A property representing the time and date when a specific object was created.

It represents time elapsed since Unix Epoch (1970-01-01 00:00:00 UTC) in milli second.

#### 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

`number`

A property representing the time and date when a specific object was edited.

It represents time elapsed since Unix Epoch (1970-01-01 00:00:00 UTC) in milli second.

#### 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`

A unique identifier designed to tell apart individual versions of a specific object.

#### 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

Returns additional information (metadata) of a specific object.

#### Parameters

#### Return

| `Dictionary` | Additional information (metadata) in key-value form. |
| ------------ | ---------------------------------------------------- |

#### 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

Returns the user ID array of a specific object.

#### Parameters

#### Return

| `Array` | An array of user IDs. |
| ------- | --------------------- |

#### 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
