Cloud APIs
MemoryStoresApi
updateSortedMapItem

updateSortedMapItem

Updates a sorted map item.

Parameters

NameTypeDescription
universeIdIdentifierThe id of the universe to get the sorted map item from.
sortedMapstringThe sorted map to get the item from.
itemIdstringThe id of the item to update.
updatedItemDataUpdateSortedMapItem_ConstructItemConfigThe data to update the sorted map item with.
allowMissing?booleanIf set to true, and the item is not found, a new item will be created. Default false.

Example

type Item = { isReal: boolean };
const { data: updatedItem } = await MemoryStoresApi.updateSortedMapItem<Item>({
  universeId: 5243626809,
  sortedMap: "MySortedMap",
  itemId: "Testing123",
  updatedItemData: { value: { isReal: true }, ttl: "300s", numericSortKey: 1 },
}); 

Example Data

{
  path: "cloud/v2/universes/5243626809/memory-store/sorted-maps/MySortedMap/items/",
  value: { isReal: false },
  etag: "20",
  expireTime: 2024-04-18T03:48:53.000Z,
  numericSortKey: null,
} 

Endpoint

PATCH /v2/universes/{universeId}/memory-store/sorted-maps/{sortedMap}/items/{itemId}