Delete item from dict PyMongo

How can I delete 3:4 for example?

{id:12345,dict : {1:2,3:4}}

filter = {“_id”: 12345}

Define the update operation using unset

update = {‘$unset’: {‘key_to_remove’: 1}} # Replace ‘key_to_remove’ with the actual key you want to remove

Update the document(s) using unset

collection.update_many(filter, update)