Managing Environment Variable Arrays


Some of the tests I’m running had additive information I’m maintaining over time. Then performing checks against those values when the data has built up and as it’s modified by related methods. Think of it like a booking system where a user can book time against rooms. An awful way of doing this was saving them as environment variables room_one, room_one_start, room_one_end. And then just increment by one for new variables.

This seems a terrible way to do things.

I’ve currently got it implemented with JSON arrays room, start, and end. I’ve also got functions in my globals that can push and pop values and store the results in my env vars. This also doesn’t seem super intuitive.

Is there a better way to do this? I feel like I’m missing something obvious.