it is possible to define a document id when inserting a document into a TinyDB database? for example (from the tutorial) https://pypi.python.org/pypi/tinydb
from tinydb import TinyDB, where
from tinydb import TinyDB, where
db = TinyDB('./db.json')
db.insert({'int': 1, 'char': 'a'})
db.insert({'int': 1, 'char': 'b'}
but if we see the generated document:
{"_default": {"1": {"int": 1, "char": "a"}, "2": {"int": 1, "char": "b"}}}
ids such as "1" and "2" where automatically decided by TinyDB. is there anyway to chose that id when inserting a document? also, it is possible to do an upsert?
thanks! :)