You have to make sure to add the Serializable attributes to the model classes. Apart from that the models are illegal as the variables start with a dash.
[Serializable]
public class Model {
public UserModel -NBDmMEcFMNkPynkW3tG;
public UserModel -NBDmO1uKeY22QD5H5DJ;
}
[Serializable]
public class UserModel {
public string userID;
}
var json = "{\"-NBDmMEcFMNkPynkW3tG\":{\"userID\":\"-NBDmMEcFMNkPynkW3tG\"},\"-NBDmO1uKeY22QD5H5DJ\":{\"userID\":\"-NBDmO1uKeY22QD5H5DJ\"}}";
var model = JsonUtility.FromJson<Model>(json);
Debug.Log(model.-NBDmMEcFMNkPynkW3tG.userID);
You could consider using an array instead.
[Serializable]
public class Model2 {
public UserModel[] users;
}
var json2 = "{\"users\":[{\"userID\":\"-NBDmMEcFMNkPynkW3tG\"},{\"userID\":\"-NBDmO1uKeY22QD5H5DJ\"}]}";
var model2 = JsonUtility.FromJson<Model2>(json2);
foreach (var user in model2.users) Debug.Log(user.userID);