update a json database

Question:

I wanted to create a sort of database in json with python, but I don’t know how to delete existing "value"

{
    { "object" : 
        { "object_id" : 012345678}} 

} 

and if the user create a new object with the same object name, but a different object I’d value, it will update.

sorry for my bad explanation

Asked By: Swampy

||

Answers:

If you are using the JSON library and trying to update data after you have added data with Python then you can use this

data = # adding stuff to the json file using json library
with open("file.json", "w") as f:
    json.dump(data, f)
Answered By: Debarka Naskar
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.