msiemens/tinydb

Repeat `_id`s

rmcgibbo opened this issue · 2 comments

I seem to be getting multiple repeated _ids when the db is opened and closed repeatedly, and each session only inserts one entry. Is this expected?

>>> TinyDB('db.json').insert({'x': 1})
>>> TinyDB('db.json').insert({'x': 1})
>>> TinyDB('db.json').all()
[{u'_id': 0, u'x': 1}, {u'_id': 0, u'x': 1}]

This is with 1.2.0 from pypi

$ pip freeze | grep tinydb
tinydb==1.2.0

Awesome!

Thanks for reporting this issue! I've just uploaded v1.3.0 where this is fixed (along with some other changes) :)