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

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

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

Version

string

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

Code Samples

Methods

GetMetaData

Returns additional information (metadata) of a specific object.

Parameters

Return

Dictionary

Additional information (metadata) in the form of key-value.

Code Samples

GetUserIds

Returns the user ID array of a specific object.

Parameters

Return

Array

An array of user IDs.

Code Samples

Events

Last updated