Upsert. First of all, thanks nice to see you added upsert. However I cant seem to get it to work. I am on version 3.7.0.
In the simple test below I try to use upsert, I get the error msg that 'Table object has no attribute upsert'.
I cant see the problem. I just did the below to illustrate the problem to show its basic, not doing anything tricky.
But what I am writing at the moment I always get a table object and i am executing methods on the returned table object. I have made the assumption that a table object is the same as working on the db instance.
Anyway, any help appreciated. It seems like if this was a bug it would have been reported already, so I feel I am doing something wrong.
def tdtest():
tdb = TinyDB('foo.json')
d = {'pk':'me', 'first':'Ian', 'last':'Smith', 'age':52}
tdb.upsert(d, where('pk') == d['pk'])