# DataStore.Options

Kind: Struct · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0

<div class="api-meta">
<span class="api-kind api-kind-struct" data-pagefind-filter="kind:Struct">Struct</span>
<span data-pagefind-filter="namespace:Sansar.Simulation">Namespace <a href="/scripting/api/sansar.simulation"><code>Sansar.Simulation</code></a></span>
<span class="api-badge api-since">Added in 37.1.0</span>
</div>

<span id="T:Sansar.Simulation.DataStore.Options"></span>

Controls how various [`DataStore`](/scripting/api/sansar.simulation/datastore) operations proceed.

```csharp
public struct DataStore.Options
```

## Members at a glance

| Kind | Members |
|---|---|
| **Fields** | [RetrieveData](#retrievedata) · [SerializerOptions](#serializeroptions) · [Version](#version) |

## Fields

### RetrieveData

<div class="api-card">
<span id="F:Sansar.Simulation.DataStore.Options.RetrieveData"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 37.1.0</span></div>

```csharp signature
public bool RetrieveData
```

DataStore.Store and DataStore.Delete will retrieve the existing data if this value is true, or if [`Options.Version`](/scripting/api/sansar.simulation/datastore.options#version) is set and is not matched. Leaving this false will provide quicker responses and the value does not need to be returned or parsed.

</div>

### SerializerOptions

<div class="api-card">
<span id="F:Sansar.Simulation.DataStore.Options.SerializerOptions"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 37.1.0</span></div>

```csharp signature
public Sansar.Utility.JsonSerializerOptions SerializerOptions
```

Options to control json serialization

</div>

### Version

<div class="api-card">
<span id="F:Sansar.Simulation.DataStore.Options.Version"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 37.1.0</span></div>

```csharp signature
public Nullable<int> Version
```

When set, DataStore.Store and DataStore.Delete will only proceed if the version of the data in the store matches this value. If the version does not match then the existing value and version will be returned.

</div>


## Used in examples

- [DataStoreExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/DataStoreExample.cs)

<p class="api-generated" data-pagefind-ignore>Generated from the Sansar 47.10.0 client ScriptApi snapshot.</p>