Skip to content
Roblox API Reference

MemoryStoreSortedMap

Provides access to a sorted map within MemoryStoreService.
  • Not creatable
  • Not replicated
Memory category
Instances
Own members
6
Inherited members
75
Subclasses
0
Siblings
608

Properties23

Inherited fromObject2

Property categoryData

Inherited fromInstance21

Property categoryBehavior

Property categoryData

Property categoryPermissions

Methods48

Inherited fromObject3
  • Get an event that fires when a given property of the object changes.
    Parameters
    ParameterDescription
    property: string
    The property to connect to.
    Returns
    TypeDescription
    RBXScriptSignal
    A signal that fires whenever the property changes.
  • Object:IsA(className: string): boolean
    Returns true if an object's class matches or inherits from a given class.
    • Custom Lua state
    • Thread safe
    Parameters
    ParameterDescription
    className: string
    The class against which the Object's class will be checked. Case-sensitive.
    Returns
    TypeDescription
    boolean
    Describes whether the Object's class matched or is a subclass of the given class.
  • Object:isA(className: string): boolean
    Deprecated: This deprecated function is a variant of Object:IsA() which should be used instead.
    • Deprecated
    • Custom Lua state
    Parameters
    Parameter
    className: string
    Returns
    Type
    boolean

    Use IsA instead.

Inherited fromInstance39
Defined byMemoryStoreSortedMap6
  • MemoryStoreSortedMap:GetAsync(key: string): ...any
    Retrieves the value and sort key of a key in the sorted map.
    • Yields
    • Capabilities: DataStore
    Parameters
    ParameterDescription
    key: string
    Key whose value and sort key to retrieve.
    Returns
    TypeDescription
    ...any
    A tuple of two values:
    • Key value, or nil if there's no item with the specified key.
    • Sort key, or nil if there's no sort key associated with the specified key.
  • MemoryStoreSortedMap:GetRangeAsync(direction: Enum.SortDirection,count: number,exclusiveLowerBound: any,exclusiveUpperBound: any,): { any }
    Retrieves items within a sorted range of keys and sort keys.
    • Yields
    • Capabilities: DataStore
    Parameters
    ParameterDescription
    direction: Enum.SortDirection
    Sort direction, ascending or descending.
    count: number
    The number of items to retrieve; the maximum allowed value for this parameter is 200.
    exclusiveLowerBound: any
    (Optional) Lower bound, exclusive, for the returned keys. This is provided as a table where one or both of key and sort key can be specified: { key: string, sortKey: Variant } .
    exclusiveUpperBound: any
    (Optional) Upper bound, exclusive, for the returned keys. This is provided as a table where one or both of key and sort key can be specified: { key: string, sortKey: Variant } .
    Returns
    TypeDescription
    { any }
    Item keys, values and sort keys in the requested range.
  • MemoryStoreSortedMap:GetSizeAsync(): number
    Gets the size of the sorted map.
    • Yields
    • Capabilities: DataStore
    Returns
    TypeDescription
    number
    The number of items currently stored in the sorted map.
  • MemoryStoreSortedMap:RemoveAsync(key: string)
    Removes the provided key from the sorted map.
    • Yields
    • Capabilities: DataStore
    Parameters
    ParameterDescription
    key: string
    Key to remove.
  • MemoryStoreSortedMap:SetAsync(key: string,value: any,expiration: number,sortKey: any,): boolean
    Sets the value of a key.
    • Yields
    • Capabilities: DataStore
    Parameters
    ParameterDescription
    key: string
    Key whose value to set.
    value: any
    Key value to set.
    expiration: number
    Item expiration, in seconds. The item is automatically removed from the sorted map once the expiration duration is reached. The maximum expiration time is 45 days (3,888,000 seconds).
    sortKey: any
    (Optional) Sort key to set for this key. Accepted types are a number (integer or decimal) or a string.
    Returns
    TypeDescription
    boolean
    true if the value of an existing key was overwritten, or false if a new key was added to the sorted map.
  • MemoryStoreSortedMap:UpdateAsync(key: string,transformFunction: (...any) -> ...any,expiration: number,): ...any
    Retrieves the value and sort key of a key from a sorted map and updates it with a new value and sort key.
    • Yields
    • Capabilities: DataStore
    Parameters
    ParameterDescription
    key: string
    Key whose value to update.
    transformFunction: (...any) -> ...any
    A function which you need to provide. The function takes the key's old value and old sort key as input and returns the new value and new sort key.
    expiration: number
    Item expiration time, in seconds, after which the item will be automatically removed from the sorted map. The maximum expiration time is 45 days (3,888,000 seconds).
    Returns
    TypeDescription
    ...any
    The return value is a tuple of the last value and sort key returned by the transform function.

Events10

Inherited fromObject1
Inherited fromInstance9