The TinyDB forum has found a new home at GitHub discussions. The content here remains as a read-only archive.
I am using a database for a warning system and need some help working it. Heres an example of the database.
"user": "Member23", "warns": 1
How would I go about adding 1 to the "warns" column so that each time I want to warn a user, it adds one to the value each time?
You could use a update operation like this one:
from tinydb.operations import increment
db.update(increment('warns'), where('user') == 'Member23')
Does this work for you?