How to get a list of all users datas?

How do I get a list of all users, including those who are currently offline? I have tried two methods so far. One is to use ListKeysAsync to get the keys, and then get the actual data. The other is to use DataStoreService to get the keys, and then get them one by one. Neither of these methods is very good, and they are also slow.

Is there any other way to get list data without using external storage? What methods do you use?

I think it’s not possible, the only way to get them is to know all the keys and then get the data using the keys. But the more players join overall in your game, the harder it gets. The datastore has a minute limit, and you would get that data for a very long time.
But I know one way, but it’s too complicated to want to do. But it also has limits. If you know how to encode and decode player data into a single number, you will be able to store it in ordereddatastore and decode, but believe me, it is not worth it.

2 Likes

Thank you for your reply.
I need to make a data management tool in the game, which can easily manage all user data, including complaints, suggestions and so on. These all require list query functions. Using pagination, I can read only a part of the data each time. I don’t need to use a specific encoding, I just need to store UserId => tick() in ordereddatastore when the user registers. Suggestions and other information can also be stored in ordereddatastore as a key => tick() when they are published, and then I can get them by page.

But this is still very slow, so I want to see if there are other ways to achieve this function.

1 Like

Only non hacky way of doing this is an external database. There’s not any easy and straightforward solution to this problem

Okay, that seems to be the case. Thank you

1 Like

There is a plugin that lets you edit your data. I’m not sure if you can still get it or if it’s even supported anymore (think there was a problem, idk). Anyways, it is hard to work with and you have to buy it. I haven’t had much luck with it over all, but it did help me clear some bad data off my datastore. If you know the keys it can list them and even change them if needed. DataStore Editor Not even sure if this can help you.

hello, why you need to get all user from the datastore ?
this is for get a better idea of why you try to archive this and maybe try to help if i can :+1:

Because I want to provide a feature. It is to provide a data management function for game administrators within the game.

Administrators can perform necessary data queries and maintenance. Because I do not plan to use third-party data storage. So the relevant management functions are planned to be implemented within the game.

This is also why I need to obtain all the data.

1 Like

Thanks, I’m not sure if this plugin uses external database. I’ll go find it

1 Like

That plugin helps with editing data from a given key, but not for getting all the data from a given datastore. If you want to do data management, you’re going to have to use an external database to collect the information you need

1 Like

is maybe not the best thing and i never try but what about use OrderedDataStore is maybe only number but you can give a name “string” and a value “number” you can maybe with this save the userid (maybe the name too but bad idea because the name can be changed) and with ordereddatastore retrive all userid with “GetSortedAsync” and get the user name from the userid “GetNameFromUserIdAsync” and only get the data from this userid when you click the user for not do a lot of resquest to roblox

I have written a plugin for managing Datastore data and tried to use it to see how much functionality is different from your previous one. If necessary, I will continue to expand the functionality.

I tried it, and clearly misunderstood your question. :man_facepalming: