Skip to content

CollectionOptions<T>

Name

Type: string

Descrption: The name in the DataStore:GetDataStore().

Required: ✅ yes

Scope

Type: string

Descrption: The scope in the DataStore:GetDataStore().

Required: ❌ no

Default

Type: T

Descrption: The default value of a DataStore entry.

Required: ✅ yes

Validate

Type:

type CollectionValidator<T> = (data: T) -> boolean

Descrption: The function that validates given data, should return true if validation has succeeded, false if failed.

Required: ✅ yes

Migrations

Type:

type CollectionMigrations = { (old: any) -> any} 

Descrption: An array of functions, that should be ordered in the order of data versions, that take in the old data, and return the new structure of the data. Useful for releasing game updates without data loss.

Required: ❌ no

Important

After a migration has been published, it should never be changed. Changes to existing migrations may break older saves.

To prevent data loss, avoid any changes to the migrations.

MaxRetries

Type: number

Descrption: The maximum number of retry attempts that a Collection will perform if an operation fails.

Required: ❌ no

Default: 3

RetryDelaySeconds

Type: number

Descrption: The delay (in seconds) between each retry attempt when an operation fails.

Required: ❌ no

Default: 2