Nov-04-2021, 04:24 PM
You can't append to JSON data like a log file or a database. If you want to add data to it you need to:
* read in the existing data to a list or dict
* append or add your data to that object
* dump the json again (which has all the information).
With a database you could just do the 'insert' and have it keep track of the old data. JSON can't do that.
* read in the existing data to a list or dict
* append or add your data to that object
* dump the json again (which has all the information).
With a database you could just do the 'insert' and have it keep track of the old data. JSON can't do that.