How can I get page contents in Datastore v2 (Beta)?

-- ...
local function getDatastore(player): DataStore
	return DataStoreService:GetDataStore("player_store", player.UserId, options)
end
local function listKeys(player)
	local datastore = getDatastore(player)
	local pages = datastore:ListKeysAsync(nil, 10)
	for _, page in pairs(pages:GetCurrentPage()) do
		print(page)
	end
end
listKeys(player)
-- ...

This returns Instance in the output but there is no auto complete for page so I am not sure how can I get the contents. What I want to do is go through all the keys in player_store.

1 Like