Class
OrderedDataStore
NotCreatableNotReplicated
A GlobalDataStore that also allows for ordered data store entries.
A OrderedDataStore is essentially a GlobalDataStore with the
exception that stored values must be integers. It exposes a method
GetSortedAsync() which allows
inspection of the entries in sorted order using a DataStorePages
object.
Ordered data stores do not support versioning and metadata, so
DataStoreKeyInfo is always nil for keys in an
OrderedDataStore. If you need versioning and metadata support, use a
DataStore.
Ordered data stores do not support the optional userIds parameter for
SetAsync() or
IncrementAsync().
See Data stores for an overview on how to use ordered data stores.
Methods 1#
| GetSortedAsync | Returns a DataStorePages object.Yields |
GetSortedAsync(ascending: boolean, pagesize: int, minValue: Variant, maxValue: Variant): DataStorePages#
Yields
Returns a DataStorePages object. The sort order is determined by
ascending, the length of each page by pageSize, and
minValue/maxValue are optional parameters which filter the
results.
See Error codes and limits for request limits and descriptions of the error codes.
| Name | Type | Default | Description |
|---|---|---|---|
ascending | boolean | A boolean indicating whether the returned data pages are in ascending order. | |
pagesize | int | The length of each page. By default is 50. The max allowed value is 100. | |
minValue | Variant | Optional parameter. If set, data pages with a value less than minValue will be excluded. | |
maxValue | Variant | Optional parameter. If set, data pages with a value greater than maxValue will be excluded. |
Returns
DataStorePages— A sortedDataStorePagesobject based on the provided arguments.
Inherited members#
Inherited from GlobalDataStore 7
Methods (7)
BatchGetAsync, GetAsync, IncrementAsync, OnUpdate, RemoveAsync, SetAsync, UpdateAsync
Inherited from Instance 58
Properties (10)
Archivable, archivable, Capabilities, IsInSandbox, Name, Parent, PredictionMode, RobloxLocked, Sandboxed, UniqueId
Methods (39)
AddTag, children, ClearAllChildren, Clone, clone, Destroy, destroy, FindFirstAncestor, FindFirstAncestorOfClass, FindFirstAncestorWhichIsA, FindFirstChild, findFirstChild, FindFirstChildOfClass, FindFirstChildWhichIsA, FindFirstDescendant, GetActor, GetAttribute, GetAttributeChangedSignal, GetAttributes, GetChildren, getChildren, GetDebugId, GetDescendants, GetFullName, GetStyled, GetStyledPropertyChangedSignal, GetTags, HasTag, IsAncestorOf, IsDescendantOf, isDescendantOf, IsPropertyModified, QueryDescendants, Remove, remove, RemoveTag, ResetPropertyToDefault, SetAttribute, WaitForChild