# DataStoreSetOptions

DataStoreSetOptions : `Instance`

## Overview

An object used to specify additional information (metadata) when using the GlobalDataStore:SetAsync() method.

## Properties

## Methods

### GetMetadata

Returns additional information (metadata) of a specific object.

#### Parameters

#### Return

| `Dictionary` | A dictionary containing the metadata registered on this object. |
| ------------ | --------------------------------------------------------------- |

#### Code Samples

```lua
local options = Instance.new("DataStoreSetOptions")
options:SetMetadata(
{
    Reason = "DailyMission"
})

print(options:GetMetadata())
```

### SetMetadata

Registers additional data (metadata) to be stored together when using the GlobalDataStore:SetAsync() method.

#### Parameters

| `Dictionary` InMetaDataTable | Additional information (metadata) in which several properties are specified in the form of key-value. |
| ---------------------------- | ----------------------------------------------------------------------------------------------------- |

#### Return

| `void` |   |
| ------ | - |

#### Code Samples

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

local success, errorMessageOrLoadValue = pcall(function()
    local userIds = nil
    local options = Instance.new("DataStoreSetOptions")
    options:SetMetadata(
    {
        Reason = "DailyMission"
    })

    GoldStore:SetAsync(player.UserId, 100, userIds, options)
end)
```

## Events


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.overdare.com/development/api-reference/classes/datastoresetoptions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
