Is there a way to get all the keys that are in a DataStore?

I want to make a getbans command, but the way I save bans is user id-banData. If it’s not possible, that’s fine, as I can make a check ban command instead, but if it is, can you tell me how?

It’s not possible to get all the keys in a Datastore. However, there are some alternatives that are similar to the goal you want to achieve.

  1. Have an OrderedDatastore that contains all the UserId who are banned.
  2. Have one table containing all the bans.

If I were to choose, it would be #1.