Skip to content

Class · inherits GlobalDataStore

DataStore

Official docs ↗

A GlobalDataStore that also supports versioning, key metadata, and enumerating keys.

About DataStore

See Data stores for an in-depth guide on data structure, management, error handling, limits, and more.

Methods 4

  • GetVersionAsync(key: string, version: string) → TupleYieldsRetrieves the specified key version.

    This function retrieves the specified key version as well as a DataStoreKeyInfo instance. A version identifier can be found through DataStore.ListVersionsAsync or alternatively be the identifier returned by GlobalDataStore.SetAsync.

  • GetVersionAtTimeAsync(key: string, timestamp: int64) → TupleYieldsRetrieves the key version that was current at a given time.

    This function retrieves the key version that was current at a given time as well as a DataStoreKeyInfo instance.

  • ListKeysAsync(prefix: string, pageSize: int = 0, cursor: string, excludeDeleted: boolean = false) → DataStoreKeyPagesYieldsReturns a DataStoreKeyPages object for enumerating through keys of a data store.

    This function returns a DataStoreKeyPages object for enumerating through keys of a data store. It accepts an optional prefix parameter to only locate keys whose names start with the provided prefix.

    If DataStoreOptions.AllScopes was set to true when accessing the data store through DataStoreService.GetDataStore, keys will be returned with all scopes as prefixes.

  • ListVersionsAsync(key: string, sortDirection: SortDirection = Ascending, minDate: int64 = 0, maxDate: int64 = 0, pageSize: int = 0) → DataStoreVersionPagesYieldsEnumerates all versions of a key.

    This function enumerates versions of the specified key in either ascending or descending order specified by a SortDirection parameter. It can optionally filter the returned versions by minimum and maximum timestamp.

DataStore also has every member of GlobalDataStore. Deprecated and Roblox-only members are hidden.

Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.