✓ Accepted answer
You can always store the user keys in a separate data store entry:
function saveData(player)
local key = generateDataKey(player)
local data = generateDataTable(player)
datastore:SetAsync(key, data)
datastore:UpdateAsync("__USERKEYS", function(knownKeys)
knownKeys = knownKeys or {}
table.insert(knownKeys, key)
return knownKeys
end)
end
Then you could grab them with
local knownKeys = datastore:GetAsync("__USERKEYS")
However, I cannot find a single well justified reason to do this. If you wanted to keep count of how many user data-entries there are, you should just store a single integer instead. Roblox doesn't want you to grab all the data at once because it all would need to be sent over the network and it could eat up the server's memory. (260000 characters = 2080000 bytes = 2,08 Mb, multiplied by the amount of data entries which could be up to hundreds of thousands, depending on the product)
1 comment
This is not possible with a global data store but you can use an ordered data store a gave the same key used in a data store.