write data

hello, i can read data like from a data base, but from a json object in my directory, but i want to modify data in that json object and store it, just to save variables in it. how can i do it??